Sen. Thad Cochran (R-Miss.) at a rally on Monday. (AP Photo/The Clarion-Ledger, Joe Ellis)

Sen. Thad Cochran (R-Miss.) was officially forced into a runoff Wednesday against tea party challenger Chris McDaniel, setting off a three-week sprint to the finish in a nasty, expensive campaign that is perhaps the last best chance for conservative activists to replace a longtime Republican senator with one of its own in 2014.

The outcome of the GOP primary race was the latest complication for Cochran, who is at risk of becoming the first U.S. senator to be dislodged this year. Conservative groups have already spent more than $5 million against the senator and have vowed to keep up their intensity heading toward the June 24 election.

The Associated Press called the race a runoff nearly 24 hours after polls closed Tuesday.

Chris McDaniel speaks to supporters Tuesday night. (AP Photo/George Clark)

With all precincts reporting, McDaniel outpaced Cochran 49.5 percent to 49 percent, with a third candidate finishing well behind the two. Because no candidate won a majority, the campaign will continue.

The more than $12 million battle has tested the might of two starkly different Republicans split along generational and ideological lines. Tuesday's result came as other tea party challengers have fizzled against more moderate Republican senators. The result of their struggles, some Republicans said, was a coalition of national tea party groups itching for a win.