Former President Donald Trump endorsed Mehmet Oz in Pennsylvania’s crucial Senate race Saturday night, throwing the power of the most popular figure in Republican politics behind the celebrity surgeon.

The announcement has the potential to shape one of the country’s most pivotal Senate primaries, in a state that will likely help decide control of the chamber. Oz and former hedge fund CEO David McCormick, the two GOP front-runners, had each been furiously lobbying for Trump’s support in the country’s most expensive primary.

They had been locked in a tight race for the GOP nomination, with some polls suggesting McCormick had taken the lead, but Trump’s endorsement seems sure to be a boon for Oz, and a significant rebuttal to opponents who have questioned his conservative credentials.

“This is all about winning elections in order to stop the Radical Left maniacs from destroying our Country,” Trump said in a statement. “The Great Commonwealth of Pennsylvania has a tremendous opportunity to Save America by electing the brilliant and well-known Dr. Mehmet Oz for the United States Senate.”

Trump’s personal familiarity with Oz (who hosted Trump on his TV show in 2016), and his affinity for a fellow celebrity, rang through in his endorsement announcement — despite questions about Oz’s conservative credentials and his past statements on issues such as abortion, gun laws, and fracking.

“I have known Dr. Oz for many years, as have many others, even if only through his very successful television show. He has lived with us through the screen and has always been popular, respected, and smart,” Trump said. “He even said that I was in extraordinary health, which made me like him even more (although he also said I should lose a couple of pounds!).”

Oz was reported to have support from former first lady Melania Trump, a dynamic the ex-president’s statement seems to hint at.

“Women, in particular, are drawn to Dr. Oz for his advice and counsel. I have seen this many times over the years. They know him, believe in him, and trust him,” Donald Trump said. “Likewise, he will do very well in Philadelphia and Pittsburgh, where other candidates will just not be accepted.”

A source familiar with Oz’s effort to win the endorsement said Trump took notice of the large crowds the TV star has drawn in his campaign events — much as Trump enjoys at his own rallies, and a contrast to what McCormick’s opponents argue is a manufactured campaign driven by consultants.

» READ MORE: Mehmet Oz knows TV. Now his GOP opponents are turning Pennsylvania’s airwaves against him.

Oz has in many ways modeled his campaign after Trump’s, promoting himself on TV as a “conservative outsider” who is too wealthy to be “bought.” Oz, in a statement Saturday night, pledged to “defend America First policies.”

“President Trump carefully reviewed all of the candidates for U.S. Senate. Everyone, especially David McCormick — a pro-China, Wall Street insider, wanted this endorsement. But President Trump wisely endorsed me because I’m a Conservative who will stand up to Joe Biden and the woke Left,” Oz said.

“President Trump knows how critical it is to change the kinds of people we send to Washington. I’m ready to fight. I thank him for that, and I am proud to receive his endorsement.”

The endorsement could be a test of Trump’s sway over the GOP, since McCormick had taken a lead in the race, according to some public polling, though Oz remained competitive. Trump’s endorsement is widely seen as a significant benefit with Republican voters, though some polling suggests it could be a drag in the general election, given the former president’s unpopularity with Democrats and many swing voters.

Pennsylvania’s Senate race is one of the most crucial contests in the country. Both parties have competitive primaries that could help shape their political futures.

McCormick and his allies have spent tens of millions of dollars in TV ads tearing down Oz by questioning his commitment to conservative policies and describing him as a RINO, a Republican in Name Only.

But McCormick had his own liabilities with the former president, including past criticism of Trump and praise for China’s economic growth when he was part of the George W. Bush administration.

» READ MORE: Mehmet Oz is worth at least $104 million and maybe a lot more, a new report says

McCormick’s team remained defiant. McCormick “is going to be the next senator from the Commonwealth of Pennsylvania,” tweeted Jeff Roe, a top McCormick adviser.

Oz and McCormick had both heavily lobbied for Trump’s support, including with personal visits to the former president’s home in Mar-a-Lago.

They each bring different strengths to the race: Oz has fame and name recognition. McCormick is an Army veteran with deeper Pennsylvania ties and support from some of the state’s most prominent GOP insiders. Both are incredibly wealthy and pouring millions into the campaign.

McCormick hired several former Trump aides, including Hope Hicks and Stephen Miller, and touted an “America First” agenda on the campaign trail. His wife, Dina Powell McCormick, had been a top Trump national security aide.

But McCormick, who has long praised free trade and moved in elite business circles, at times appeared an awkward fit for Trump-style populism, despite his attempts to appeal to Trump supporters.

» READ MORE: Let’s talk about that David McCormick ‘Let’s Go Brandon’ Super Bowl ad

The person familiar with Oz’s efforts to win the endorsement said that while McCormick and his allies relentlessly pressed Trump for his support, the surgeon was more circumspect and relied on his long-standing personal ties to the former president and his family. The source spoke on the condition of anonymity to discuss private meetings.

The endorsement is Trump’s second in the Senate race. Last summer he backed Army veteran Sean Parnell, though Parnell dropped out less than three months later after his estranged wife accused him of physical and verbal abuse. Parnell denied the accusations, but a judge in the couple’s custody case sided with Parnell’s wife, Laurie Parnell.

Pennsylvania’s incumbent Republican Senator, Pat Toomey, isn’t seeking reelection this year.