Rep. Jerry MoranGerald (Jerry) MoranFlake to try to force vote on DACA stopgap plan Congress punts fight over Dreamers to March The 14 GOP senators who voted against Trump’s immigration framework MORE (R-Kan.) narrowly defeated fellow Rep. Todd Tiahrt (R-Kan.) Tuesday in a Senate primary that went down to the wire.

The AP called the race for Moran with 86 percent of precincts reporting. Moran was ahead of Tiahrt 49 percent to 45 percent.

Moran and Tiahrt spent more than $2 million in the final two weeks of a nasty Republican primary for Senate.

In this heavily GOP state, Moran is now the prohibitive favorite to win the seat of Sen. Sam Brownback (R-Kan.) in the fall. Brownback opted to launch a bid for governor.

The race between the two GOP lawmakers, who have served side by side in the House of Representatives and in Kansas state Senate, turned ugly early. Like most Republican primaries this season, it was a battle to win conservatives.

In the final week of the race, Moran attacked Tiahrt over an old House ethics probe, from which he was cleared two years ago. And Tiahrt continued to question Moran's conservative credentials.

Independent polling in the race showed Moran up large margins for most of the campaign, but the race tightened ahead of Tuesday's primary. The last Survey USA poll in the race gave Moran just a 10-point lead over Tiahrt. Earlier polls had Moran up nearly 30 points.

The two campaigns also sparred over internal polls throughout the race, with both camps accusing the other of push-polling.

Both Tiahrt and Moran had backing from prominent conservatives. Former Alaska Gov. Sarah Palin (R) and presidential advisor to George W. Bush Karl Rove endorsed Tiahrt, while Moran was backed by Sen. Jim DeMint (R-S.C.), who made a July campaign appearance on his behalf, and Sen. Tom CoburnThomas (Tom) Allen CoburnPaul Ryan should realize that federal earmarks are the currency of cronyism Republicans in Congress shouldn't try to bring back earmarks Republicans should know reviving earmarks is a political nightmare MORE (R-Okla.).

Turnout-wise, Moran had a distinct advantage in the closed Republican primary in that his congressional district had some 35,000 more Republican registrants than the district represented by Tiahrt.