Sen. Dean Heller (R-Nev.) asks a question of Treasury Secretary Steven Mnuchin during a Senate Banking Committee hearing on Capitol Hill in Washington on Jan. 30, 2018. (Susan Walsh/AP)

President Trump ended a nasty intraparty duel Friday by persuading a Republican running a populist, unabashedly pro-Trump campaign to abandon his effort to unseat Sen. Dean Heller (R-Nev.) this year.

The challenger, Danny Tarkanian, said he would seek a Nevada House seat instead, removing a major headache for GOP strategists who are looking to preserve or even expand the one-seat Republican Senate majority in November’s midterm elections. A competitive GOP primary would have boosted Democrats who are hoping to snatch the seat.

Tarkanian said in a statement Friday that Trump “and members of his political team” approached him Wednesday and asked him to make the switch.

“I am confident I would have won the U.S. Senate race and done a great job representing the people of Nevada in the Senate, but the President is adamant that a unified Republican ticket in Nevada is the best direction for the America First movement,” he said. “With President Trump’s full support and endorsement, I am filing to run again in [the 3rd Congressional District] with the firm belief that we will finish what we started in 2016 and win in 2018.”

Tarkanian made the announcement Friday, shortly after Trump suggested on Twitter that he leave the Senate race because it “would be great for the Republican Party of Nevada, and it’s unity if … Dean Heller, who is doing a really good job, could run for Senate unopposed!”

Tarkanian, the son of legendary college basketball coach Jerry Tarkanian, announced his primary challenge to Heller last August, after Heller flipped and flopped on whether to support the Republican health-care overhaul backed by Trump. “We’re never going to make America great again unless we have senators in office supporting President Trump,” Tarkanian said on Fox News Channel in announcing his run.

The primary had emerged as an additional hurdle for Heller, who already faced a tough general election in a state that voted for Hillary Clinton over Trump in 2016. Tarkanian’s challenge has been seen as part of an anti-establishment tide within the Republican Party, one that has largely been identified with former Trump strategist Stephen K. Bannon but has receded somewhat since Bannon left the White House in January.

Even so, Heller had already tacked rightward in response to Tarkanian’s candidacy, co-sponsoring a conservative health-care plan last fall and backing Trump’s relatively hard-line immigration proposal after supporting more moderate legislation in the past. To emerge from a hard-fought Republican primary, Heller would almost certainly have had to take positions that would make his general election prospects even dicier.

Heller is expected to face Rep. Jacky Rosen, a freshman congresswoman who has the backing of Nevada’s Democratic establishment.

“Senator Heller spent the last eight months falling in line with President Trump, and this backroom deal is his special reward for caving to the White House’s pressure on health care,” Rosen said in a statement Friday. “If he thinks Nevada voters will forget as he tries to rewrite his failed record all over again, he’s got another thing coming.”

Nevada is the only state with a Republican incumbent seeking reelection this year in a state Clinton won, and Heller’s reelection is crucial to Republicans’ effort to preserve and possibly expand their one-seat Senate majority in the 2018 midterms.

Democrats are generally on defense, with 10 of the party’s incumbents seeking reelection in states Trump won in 2016. But there are holes in the GOP map: The retirements of Sen. Bob Corker (Tenn.) and Jeff Flake (Ariz.) have created opportunities for Democratic pickups.

And Sen. Thad Cochran (R-Miss.)’s retirement this month has some GOP strategists fearing a potential repeat of last year’s special election debacle in Alabama where Democrat Doug Jones won a Senate seat after Republicans nominated Roy Moore, a conservative hard-liner.

Tarkanian was eagerly running to Heller’s right, ridiculing him as “D.C. Dean” and dismissing him as an establishment politician who had lost touch with the GOP’s conservative base by, for instance, refusing for months to say whether he had voted for Trump.

Heller said in a statement that he appreciated Trump’s apparent endorsement: “We’ve accomplished a lot in the last year including cutting taxes for hardworking Nevadans and making sure that Nevada’s 300,000 veterans can access the health care and benefits that they need and deserve. The President’s pro-growth agenda is already showing results in Nevada.”

Tarkanian previously ran against Rosen, and lost, in the 3rd district in 2016. He also ran unsuccessfully in Nevada’s 4th district in 2012; for the U.S. Senate seat held by Harry M. Reid (D) in 2010; for Nevada secretary of state in 2006; and for the Nevada state Senate in 2004.

In his statement Friday, Tarkanian said dropping out of the Senate race “was not something I ever considered.” He added that “public service is doing what is in the best interest of the people you represent, not yourself politically.”

“I believe with every ounce of my body that the future of our country, and a better life for our children, requires the implementation of the America First agenda,” he said.