Sen. Thad Cochran (R-Miss.) leaves a pre-election day rally at the Mississippi Agriculture and Forestry Museum in Jackson, Miss., on Monday. (Joe Ellis/AP)

The intense struggle for control of the Republican Party came to a dramatic head in Mississippi Wednesday morning and could be headed for another round, with the campaigns of Sen. Thad Cochran and tea party-backed Chris McDaniel each saying they were prepared for a runoff following an intense primary contest that was too close to call after nearly all ballots were counted.

With more than 99 percent of the vote tallied, McDaniel was ahead by less than one percentage point. McDaniel had 49.6 percent of the vote to Cochran’s 48.9 percent, with a third candidate at under 2 percent. If no candidate can claim more than 50 percent of the vote, it would mean a second faceoff, on June 24.

Cochran went into the contest at risk of becoming the first U.S. senator to be toppled this year in an ongoing struggle between the GOP establishment and the conservative insurgency. He did not address supporters Tuesday night.

At 1:20 a.m. Wednesday, Cochran’s official campaign Twitter account tweeted, “Dead heat! Less than 500 votes separate the two candidates. New campaign starts tomorrow. Three weeks to victory!” His spokesman, Jordan Russell said, “We expect a runoff.”

McDaniel appeared prepared for runoff, too, tweeting late Tuesday, “Whether it’s tomorrow, or whether it’s three weeks from now, we WILL stand victorious.”

Election Lab: See our current forecast for every congressional race in 2014

The antitax Club For Growth, a group that spent about $2.5 million backing McDaniel, called on Cochran to drop out and promised to “vigorously pursue this race to its conclusion,” should he refuse.

The more than $12 million campaign tested the might of two starkly different Republicans split along generational and ideological lines. It came as tea party challengers elsewhere fizzled against more moderate GOP senators. The result, some Republicans said, was a coalition of national tea party groups desperate for a victory.

“They really want a McDaniel win because they want a head on the mantel,” party strategist Ford O’Connell said. Tea party groups “need to be able to raise money” to stay afloat, he added, “and to raise money, you have to show results.”

Senate Minority Leader Mitch McConnell (Ky.) and his top lieutenant, Sen. John Cornyn (Tex.), cruised past conservative challengers earlier this year. The competition against Sen. Pat Roberts (Kan.), Lamar Alexander (Tenn.) and Lindsey O. Graham (S.C.) has stumbled ahead of upcoming elections.

The National Republican Senatorial Committee issued a brief statement early Wednesday pledging to support Cochran if a runoff is triggered.

“Should Mississippi go to a runoff, we will expect a vigorous debate about the future of our country over the next three weeks and we will continue to fully support Thad Cochran,” said NRSC political director Rob Collins. “We look forward to him emerging victorious in the runoff.”

Mississippi was one of eight states that held primaries Tuesday. Senate Republicans also were watching Iowa, where state Sen. Joni Ernst easily clinched the party’s nomination in a key open race.

Unlike in Mississippi, tea party and establishment forces were united behind Ernst, who was backed by former governors Sarah Palin of Alaska and Mitt Romney of Massachusetts.

In South Dakota, former governor Mike Rounds easily won the Republican Senate primary as expected and advanced to a showdown against Democrat Rick Weiland, who was an aide to former senator Thomas A. Daschle.

In New Jersey, Sen. Cory Booker (D) will face Republican Jeff Bell in November. Bell lost the 1978 Senate race to Democrat Bill Bradley. In the swing district being vacated by retiring Rep. Jon Runyan (R), GOP establishment-backed businessman Tom MacArthur easily defeated tea-party-aligned Steve Lonegan. He will face Burlington County Freeholder Aimee Belgard, who won the Democratic nomination.

Conservative groups, including the Club for Growth and the Senate Conservatives Fund, together spent more than $5 million for McDaniel in Mississippi, according to a Sunlight Foundation tally, compared with $2.8 million from pro-Cochran forces. The heavy spending leveled the playing field for McDaniel, who was outspent 3 to 1 by Cochran.

Cochran, 76, is in his sixth term. In 1978, he became the first Republican elected to the chamber from Mississippi since Reconstruction.

His traditional Republican style drew the ire of tea party groups, which castigated the senator for voting to raise the federal debt ceiling and avidly earmarking federal money.

Cochran defended his record. But despite calls from McDaniel for a face-to-face debate, he never agreed to one.

McDaniel, 41, ran as a constitutional conservative committed to reining in spending and opposing the federal health-care law. But he has made controversial comments that have raised GOP fears that he could put a safely Republican seat at risk in the general election against former congressman Travis Childers, a capable Democratic recruit.

McDaniel has wavered on Hurricane Katrina relief and blamed hip-hop culture for gun violence in Canada. Some Republican strategists fear such remarks could alienate centrists.

“He’ll immediately have to figure out a way to appeal to mainstream voters and beat back the partisan attacks by the other side,” said Republican strategist Ron Bonjean, referring to conservative candidates who imploded in recent years. “Hopefully he will have learned the lessons of why Todd Akin, Richard Mourdock and Sharron Angle failed.”

McDaniel supporters say he would give the Senate GOP a much-needed shot in the arm.

“The reason Republicans lost the majority is because they had a do-nothing Senate. And Thad Cochran was one of those do-nothing senators,” said L. Brent Bozell III, whose group, ForAmerica, spent money on McDaniel.

The Cochran-McDaniel race grew deeply personal in the final weeks after a pro-McDaniel blogger was arrested for allegedly filming Cochran’s bedridden wife and posting at least one image in an online video. Cochran’s wife has dementia and lives in a nursing home.

McDaniel and his campaign insisted that they played no part in the episode. But Cochran’s campaign suggested that the challenger’s team knew more than it let on.

Cochran relied on Mississippi Republicans such as Gov. Phil Bryant and Lt. Gov. Tate Reeves to campaign with him on the eve of the election. McDaniel campaigned with national conservative figures Palin and former senator Rick Santorum (Pa.) in the final days.

Voters in Alabama, California, Montana and New Mexico also went to the polls Tuesday. In California’s all-party primary, the top two candidates advance to the general election regardless of party affiliation.

In California 31st Congressional District, a left-leaning seat Democrats embrassingly lost in 2012, Republican Paul Chabot advanced to the next round. But with all precincts reporting, the second spot remained in doubt with Redlands Mayor Pete Aguilar (D) clinging to under a one point lead over Leslie Gooch (R), a former aide to retiring Rep. Gary Miller (R). The AP had not called in the contest as of Wednesday morning.

At the top of the California ticket, former U.S. Treasury aide Neel Kashkari, a moderate Republican, edged out tea-party-aligned Assemblyman Tim Donnelly (R), earning a chance to take on Gov. Jerry Brown (D) in November.

With all precincts reporting in Mississippi’s 4th District Republican primary, Rep. Steven Palazzo sat in first place with 50.5 percent of the vote. But the AP had not called the race in his favor Wednesday morning, leaving open the possibility of a runoff against former congressman Gene Taylor, who finished second.

The Republican nominee in Iowa’s 3rd District, a battleground area being vacated by retiring Rep. Tom Latham (R), will be decided by party activist at a June 21 convention after no candidate claimed more than 35 percent of the vote.