Republican Danny Tarkanian talks with a reporter Friday, March 16, 2018, at the Clark County Government Center in Las Vegas about President Trump asking him to switch from running for U.S. Senate to running for a Congress seat in Nevada. (Ken Ritter/AP)

President Trump ended a nasty intraparty duel 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 Friday he would seek a U.S. House seat from Nevada instead, removing a major headache for GOP strategists who are looking to preserve or even expand the 51-49 Republican Senate majority in November’s midterm elections. A competitive GOP primary could have boosted Democrats hoping to snatch the seat.

A Democrat’s success in a House race in a Republican slice of Pennsylvania this week jolted an already nervous GOP bracing for midterm losses. The move by Tarkanian provided some stability.

Tarkanian said in a statement 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 shifted 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. In a statement, Rosen said 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. 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 where Clinton won with a Republican incumbent seeking reelection this year, and Heller’s reelection is crucial to Republicans’ Senate majority.

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 the retirement of Sen. Thad Cochran (R-Miss.) 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.