WASHINGTON — Six-term Republican Sen. Thad Cochran and tea party-backed challenger Chris McDaniel dueled at close quarters in Mississippi’s primary election Tuesday night, an epic struggle in a party divided along ideological lines. GOP governors in South Dakota and Alabama coasted to renomination.

On the busiest night of the primary season, former South Dakota Gov. Mike Rounds won the Republican nomination for the Senate – and instantly became the favorite to pick up a seat for the GOP in its drive to capture a majority this fall.

There were Senate primaries in seven states, including Iowa, where Republican state Sen. Joni Ernst took an early lead over her rivals for the right to oppose Rep. Bruce Braley in the fall for a seat long in Democratic hands.

Five states picked nominees for governor, including California, where Democrat Jerry Brown sought renomination to a fourth term.

In the marquee contest of the night, Cochran, 76, and the 41-year-old McDaniel remained locked in a close race as the vote count mounted. Returns from 78 percent of the state’s precincts showed McDaniel edging ahead in a three-way race, but a June 24 runoff was possible.

Dozens of nomination races for House seats dotted the ballot, too, including 38 in California’s open primary system, which awarded spots on the November ballot to the two top vote-getters regardless of party.

The Senate contest between Cochran and McDaniel drew top billing, a heated race between a pillar of the GOP establishment who has helped funnel millions of dollars to his state and a younger state lawmaker who drew backing from tea party groups and former Republican vice presidential candidate Sarah Palin. The campaign took a turn toward the sensational when four men, all McDaniel supporters, were arrested and charged with surreptitiously taking photographs of the senator’s 72-year-old wife, who suffers from dementia and has long lived in a nursing home.

One black group, “All Citizens for Mississippi” Cochran’s supporters advertised in two black newspapers and handed out fliers in the race’s final days as they appealed to traditionally Democratic voters.

The race was arguably the year’s last good chance for the tea party to topple an establishment favorite in a Senate primary, following losses in Texas, North Carolina, Georgia and Kentucky.

The impact of the race seemed less in the national battle for control of the Senate, where Republicans need to gain six seats this fall to capture a majority.