It’s official: Mark Begich will face Dan Sullivan this fall in one of the most closely watched Senate contests of 2014.

Sullivan, the state’s former attorney general, won the Alaska Republican primary with 40.1 percent of the vote, with 98 percent of precincts reporting, according to Politico. He had been widely expected to defeat Lt. Gov. Mead Treadwell and former Republican Senate nominee Joe Miller.

What’s surprising about the results is that Miller took second, leading Treadwell by 7 points. Republican pollsters have drawn substantial criticism this primary cycle, and the fact that they largely failed to predict Miller’s second-place finish should give their critics more ammunition.

Miller, beloved by many Tea Partiers, drew last-minute endorsements from Sarah Palin and Mike Huckabee.

This contest could be one of the closest in the country. Begich is considered one of the cycle’s most vulnerable incumbents, and he has the unenviable task of running as a Democrat in a state that Mitt Romney won by 14 points in the 2012 presidential election. Justin Barasky, a spokesman for the Democratic Party’s senatorial campaign arm, told the Washington Examiner earlier this week that the Republican primary’s ugliness had been a boon to Begich.

“That’s a good solid half of why Mark Begich has the lead there,” he said at the time.

Washington Republicans cheered Sullivan’s win.

"I look forward to serving with Dan Sullivan in a new Republican majority that is focused on getting things done from the bottom up rather than the top down,” said NRSC Chairman and Kansas Sen. Jerry Moran in a statement.