Nevada Sen. Dean Heller is testing the political perils of opposing President Trump from inside his own party, with the entrance into the 2018 Republican primary Tuesday of Danny Tarkanian.

Tarkanian, a five-time failed candidate for public office, is wrapping himself in the mantle of Trump, vowing to be an enthusiastic, loyal soldier for the president in the Senate, where Heller tends to vote with the White House, though not blindly and at times reluctantly.

"I am a conservative Republican who supports the policies of President Trump to repeal Obamacare and end illegal immigration," Tarkanian said in a statement. "I will continue to support President Trump's policies that have led to a 20 percent increase in the stock market in just six months."

Heller endorsed former Florida Gov. Jeb Bush in the 2016 GOP presidential primary and never fully embraced Trump after he won the nomination. The senator sparked the president's ire recently by opposing the initial version of the Senate GOP proposal to partially repeal Obamacare.

He later voted for an amended package, but not before Trump's official outside political group, America First Policies, ramped up an advertising campaign in Nevada to punish Heller and the president personally chided him for throwing a wrench in the gears of the repeal effort.

Trump lost Nevada to Democrat Hillary Clinton, and the swing state's growing nonwhite population and drift leftward was already serving to make Heller a vulnerable target for the Democrats, who have few opportunities to gain seats in 2018.

Having to fight through a GOP primary theoretically complicates the senator's effort. Heller already is under pressure for waffling on Obamacare repeal, not to mention the weight of Trump's low approval ratings.

But his supporters and other GOP insiders are confident — in large part because of Tarkanian, who lost a congressional bid last year to freshman Rep. Jacky Rosen, the Democratic establishment's choice to take on Heller.

An ally of Heller's said Tuesday that the opposition research file on Tarkanian is thick, and would be emptied if need be.

"Tarkanian provides disgruntled donors a place to land temporarily and he gives Democrats a reason to be optimistic," added a Nevada Republican strategist unaffiliated with the incumbent. "But once the dust settles, Republicans will have a choice to make between an imperfect Heller or an unelectable, fatally flawed, Tarkanian."

Tarkanian, said Heller campaign spokesman Tommy Ferraro, has "wasted conservatives' time and cost the Republican Party seats up and down the ballot. If he ultimately files for U.S. Senate he will lose in the primary."

Tarkanian might get quiet attaboys from a White House that enjoys watching Heller squirm, and pick up support from Republican primary voters in Nevada that were quite supportive of Trump in the 2016 presidential caucuses that he won going away.

But most of the official party apparatus already made clear it will do what's necessary to protect Heller next year.

The senator is close friends with Nevada's popular GOP governor, Brian Sandoval, and he can count on financial backing from Senate Leadeship Fund, the super PAC aligned with Senate Majority Leader Mitch McConnell, R-Ky., and the NRSC, the Senate GOP campaign arm.

Meanwhile, Ed Goeas, the veteran Republican consultant that has long advised Tarkanian, cut ties with him after he announced for Senate. Goeas' firm, The Tarrance Group, also advises Heller. The GOP establishment is likely to put a chill on Tarkanian's ability to hire a top-tier team.

"I made it very clear in no uncertain terms I thought it was a foolish idea, that I would not be involved," Goeas told the Washington Examiner in a telephone interview.

Tarkanian is optimistic, telling Nevada talk radio host Kevin Wall, who broadcasts in Las Vegas and Reno, that he decided to run for Senate over the weekend, that he is confident he would defeat Heller and win a rematch with Rosen, if she wins the Democratic nod.

However, he doesn't appear to have a strategy yet, beyond raising money and hiring campaign staff.

"We don't have a game plan put together," Tarkanian told Wall. "The most important thing at this time is raising money and getting your staff organized. We're going to work on both of those over the next several weeks."

He has his work cut out for him. Heller closed the second quarter fundraising period with $3.6 million in cash on hand in his campaign account, and zero debt.