Mitt Romney failed to win the Utah Republican Party’s nomination for a Senate seat, which means he must compete in a June primary against Mike Kennedy. (Video: Reuters)

Mitt Romney, the 2012 Republican presidential nominee now seeking a Senate seat in Utah, was dealt a setback Saturday after his party's delegates denied him their nomination, forcing him into a June 26 primary.

Romney, whose bid for the seat was endorsed by President Trump and retiring Sen. Orrin G. Hatch (R-Utah), came in second place after a lengthy and contentious party convention in Utah's West Valley City. Mike Kennedy, a three-term state representative with no national profile, edged out Romney with 50.18 percent of the delegate vote; the former Massachusetts governor won 49.12 percent.

The result secured ballot slots for both Romney and Kennedy in Utah's first Republican primary for a Senate seat since 2012. It was nonetheless an unwelcome surprise for Romney, who had entered the race Feb. 16 with plenty of fanfare and national support.

According to Federal Election Commission reports, Romney had raised $1.68 million for the campaign; Kennedy had raised just over $289,000. But Kennedy had depicted himself as a bona fide Utahn and portrayed Romney as an interloper.

“We need a candidate who’s actually lived, worked and raised a family in the state of Utah,” Kennedy said last month as he entered the race.

Until winning the presidency, Trump had not shown much strength with Republicans in Utah. In 2016, he ran in third place out of three remaining candidates in the state's presidential caucuses, winning just 14 percent of the vote. Republicans briefly fretted that Trump would lose the state's electoral votes in the fall, as Evan McMullin, a member of the Church of Jesus Christ of Latter-day Saints, gained steam as an independent candidate. In the end, Trump won just 45.1 percent of Utah's presidential vote, good enough for victory but less than any Republican presidential candidate had won in the state since 1992.

During that campaign, Romney became one of Trump's most prominent Republican critics. In March 2016, Romney delivered a lengthy condemnation of Trump in Salt Lake City, urging Republican voters to back whichever candidate could stop Trump in their states' primaries.

“Donald Trump is a phony, a fraud,” Romney said. “His promises are as worthless as a degree from Trump University. He’s playing the members of the American public for suckers. He gets a free ride to the White House, and all we get is a lousy hat.”

Romney's approach to Trump softened after the presidential election. In late November 2016, he had dinner with the incoming president, telling reporters he had “increasing hope” in what he might do with the White House and flirting with an appointment as secretary of state.

As a Senate candidate, Romney had taken that same wait-and-see approach to Trump. In February, he thanked the president for endorsing him; in March, he told Utah voters that he was “more of a hawk than even the president” on immigration policy.

But on Saturday, in an interview with CNN's Maeve Reston,  Romney evaded a question about whether he would return the favor and endorse Trump for 2020.

“As a person of political experience, if I endorse someone, I'll want to know what's in it for Utah and what help would he provide for us on key priorities in Utah,” he said.