A Trump-backed celebrity doctor's campaign to run as the next Republican senator for Pennsylvania has come down to a nail-biting conclusion.
Mehmet Oz, a surgeon best known for his appearances on the Oprah Winfrey Show, is facing a cliffhanger vote count after the party primary.
He was neck and neck with former hedge fund executive David McCormick.
The winner of the Republican primary will face the Democratic nominee, John Fetterman, this autumn.
Tuesday's race in a key presidential swing state is being closely watched as a litmus test of former President Donald Trump's sway over the Republican party.
Trump-backed Gen Z congressman ousted amid scandal
A simple guide to the US midterm elections
Earlier this month, Mr Trump's pick for the Ohio Senate primary cruised to victory against his opponents.
But Pennsylvania's primary has gone down to the wire.
The BBC's Nomia Iqbal, who attended Mr Oz's primary-night event on Tuesday, said the mood was quiet and lacking in optimism.
Despite Mr Trump's endorsement for the TV doctor, the race stayed in a three-way dead heat until polls closed.
The Republican contest was shaken up by a late surge from right-wing commentator Kathy Barnette.
But Mr McCormick came from behind to snatch a wafer-thin lead in Tuesday night's vote count. All three candidates sought to convince voters they were loyal to Mr Trump's "America First" ideology.
Mr McCormick won support from Mr Trump's former secretary of state Mike Pompeo and Republican Texas Senator Ted Cruz.
Analysis: Pennsylvania primary marks test of Trump's strength
By Nomia Iqbal, BBC News
Dr Oz arrived at the venue and did a thumbs up to us and said he was feeling good. Taking to the stage he thanked everyone who supported him and made it clear he wasn't conceding.
He said victory would be his in the end. But his closest rival Dave McCormick - who wasn't backed by Mr Trump - said the same thing.
The results are still being counted but at the moment it's within the margins for a recount. The full count of the actual ballots could take days.
It feels a lot like 2020 when we were here for the presidential race. In the end Pennsylvania projected for Biden taking him over the threshold.
Tonight was a critical test of the former President Trump's ability to back winners… He wants to use the Primaries to prove his dominance over the Republican Party.
Mr Trump really got behind Dr Oz - whether his base did is yet to be decided.
The eventual Republican winner will take on Lt Gov John Fetterman, who easily won the Democratic Senate nomination on Tuesday night - two days after announcing he had suffered a stroke.
On Monday, the left-wing Democrat's team said he had undergone surgery to implant a pacemaker with a defibrillator.
Mr Fetterman, a Harvard-educated former mayor who sported hoodie sweatshirts instead of suits on the campaign trail, remained in hospital on the night of his election victory, with his wife speaking at a campaign event in his place.
He defeated Democratic rival Conor Lamb, a moderate congressman.
This is the first open Senate seat in Pennsylvania in 12 years, with Republican Pat Toomey resigning at the end of his term.
With the Senate split 50-50, Democrats hope to shift the balance by picking up a second Pennsylvania Senate seat in November's mid-term elections.
In a White House statement on Tuesday night, Mr Biden congratulated Mr Fetterman and argued that the Republican candidates were "too extreme".
But a racially tinged controversy that dogged Mr Fetterman in his primary campaign is certain to be raised by Republicans during the general election.
In 2013, during Mr Fetterman's second term as mayor of Braddock, a town of around 2,000 outside Pittsburgh, he pursued an innocent black jogger who he wrongly thought had been firing a gun near his home.
Mr Fetterman, who is a hulking 6ft 8in and was armed with a shotgun during the confrontation, has refused to apologise for the incident.
Elsewhere in the state on Tuesday night, Republican state legislator Doug Mastriano won the party's nomination for the governor's race with the endorsement of Mr Trump.
Mr Mastriano has been a vocal backer of Mr Trump's baseless allegation that he was the real winner of the 2020 presidential election.
In November, Mr Mastriano will go up against state attorney general Josh Shapiro, who was unchallenged for the Democratic nomination.