MONTPELIER — Mark Donka emerged as the victor Wednesday in the GOP primary for U.S. representative, setting up a rematch of two years ago when Rep. Peter Welch, D-Vt., easily defeated the Hartford police officer.

The three-way contest remained very close into Wednesday, but the Associated Press called the race for Donka around 2:45 p.m. The AP, using returns it collected independently from town and city clerks, determined that Donka beat Donald Russell by just 321 votes.

The secretary of state’s website Wednesday showed that 244, or nearly 89 percent of the state’s 275 precincts, had reported results. Donka, according to the secretary of state’s numbers, had amassed 3,749 votes, or 34 percent. Donald Russell was second with 3,566 votes, accounting for 32 percent of the vote. Donald Nolte was third with 3,121 votes, or 28 percent.

Donka will go on to challenge Welch, first elected in 2006, who did not have a primary challenge.

Meanwhile, Democratic Gov. Peter Shumlin is now certain to face off against Republican Scott Milne. Shumlin, who is seeking a third term, easily defeated primary challenger H. Brooke Paige as expected, receiving 78 percent of the vote.

Shumlin was so confident that he scheduled his vacation during the primary. His campaign issued a statement on his behalf Tuesday night after his race was called by the Associated Press.

“Serving as Vermont’s governor is the greatest privilege of my life, and I’m thankful for the support I received today and over the years,” Shumlin said in the statement. “In the last four years we’ve made great progress together, and I’m incredibly proud that Vermont is leading America in so many ways. With one of the nation’s lowest unemployment rates, the top solar job creation ranking and businesses that are innovating and growing jobs, our future is bright and full of opportunity.”

Milne easily won the GOP nomination over his primary foes. With 244 precincts reporting to the secretary of state’s office Wednesday, Milne had a resounding 72 percent of the vote. Emily Peyton and Steve Berry, who also appeared on Tuesday’s ballot, had less than 7 percent each.

But in a clear sign of lingering discontent within the state GOP, 14 percent of voters chose to write in a candidate. Most of those nearly 2,000 votes presumably are for Libertarian Dan Feliciano, who was waging an aggressive write-in campaign to thwart Milne.

Feliciano was being backed by some GOP officials, including Mark Snelling, the party’s treasurer and former candidate for lieutenant governor himself. Brady Toensing, the party’s vice chairman, also came out in support of Feliciano.

Most of Milne’s opponents say he has not expressed sufficient opposition to Shumlin’s proposed universal, publicly financed health care plan.

The support from those officials shows that an interparty squabble last fall and winter is not fully resolved. Republican Lt. Gov. Phil Scott, a moderate, picked David Sunderland to serve as the state party’s chairman, but was opposed by a more conservative wing including Snelling, Toensing and Republican operative Darcie Johnston, who is volunteering on behalf of Feliciano.

Feliciano will appear on the general election ballot as the Libertarian candidate. Whether he can maintain the support he received from Republicans in the primary now that Milne has secured the GOP nomination remains to be seen. Johnston said she will continue her effort to help the Libertarian defeat both Shumlin and Milne.

The Republican Governors Association issued a statement Tuesday night congratulating Milne on his primary win. However, spokesman Jon Thompson, when asked if the group would provide significant resources to help Milne, hedged.

“The RGA is keeping a close eye on the race and we are confident Scott Milne’s message of reform will resonate with voters,” he wrote in an email.

Progressive Dean Corren appeared to secure enough write-in votes in the Democratic primary for lieutenant governor to secure that nomination. About 5,000 write-in votes were cast, but who received them remains unclear. Clerks were required to report the number of votes Tuesday but not for whom they were cast. Official results will be available next week when the votes are certified.

Corren, who will appear on the November ballot as a Progressive, needed at least 250 votes to win the Democratic nomination. Some Republicans and moderate Democrats were looking to write in Scott, but that effort did not appear to be as robust as Corren’s effort.

Scott remains the favorite in the general election, but securing the Democratic nomination could boost Corren’s chances.