In a tight runoff contest, Sen. Thad Cochran manages to eke out a victory against his tea party challenger, Chris McDaniel.​ (WLOX)

In an e-mail sent late last week, the black Democratic mayor of Vicksburg, Miss., urged 2,000 supporters to vote Tuesday for Sen. Thad Cochran, crediting the Republican for securing federal money for key local projects and calling him one of the city’s “best economic development tools.”

The voice of an African American state lawmaker was heard in a recorded phone call Tuesday asserting that Cochran stood between the state and a tea party conservative who would do away with government services. And full-page ads in black newspapers lauded the senator as a champion of historically black colleges.

An intensive strategy over the past three weeks to draw black voters to the polls and spare Cochran from what once seemed like a certain defeat at the hands of a tea party challenger in Tuesday’s GOP runoff appears to have worked.

[EXPLORE: Election results from key races in 7 states]

Voter data shows that turnout rose sharply in Tuesday’s election in black areas of the state over the initial June 3 primary, a runoff made necessary when Chris McDaniel narrowly edged Cochran but was unable to win 50 percent of the vote.

That suggested that not only did traditionally Democratic black voters turn out on behalf of the state’s 76-year-old white Republican senator, but they may have provided his margin of victory. Mississippi’s open primary system allowed Democrats to vote in the GOP election, provided they had not participated in the June 3 Democratic primary.

In Mississippi’s 24 counties with a majority black population, turnout increased an average of 40 percent over the primary, according to a Washington Post analysis. In the state’s 58 other counties, the increase was only 16 percent.

Just 12 percent of the nearly 375,000 votes cast Tuesday came from counties where African Americans make up at least 60 percent of the population. But Cochran’s overwhelming performance in those areas — winning 71 percent of the vote — provided an 18,000-vote margin that helped him grow his vote total by almost 40,000 ballots over the June 3 primary.

Cochran won Tuesday by 6,693 votes.

“They had a ground game [Tuesday] that they didn’t have in the primary,” said George Flaggs Jr., the Vicksburg mayor, who sent the e-mail urging support for Cochran. “They mobilized through churches with literature and pamphlets. They put more signs up in black areas. They made the election about the man and not the party.”

The effort to appeal to Democrats faced a furious backlash Wednesday from some conservatives, led by McDaniel, who decried the strategy during a speech to supporters Tuesday night in which he refused to concede the race.

The McDaniel campaign said Wednesday that the election was “rife with irregularities” because of the efforts to bring Democrats to the polls, and issued a statement quoting McDaniel vowing to consider a potential legal challenge.

“We must be absolutely certain that our Republican primary was won by Republican voters,” the campaign statement quoted McDaniel as saying. “In the coming days, our team will look into the irregularities to determine whether a challenge is warranted.”

Adding to the strange bedfellows nature of Tuesday’s vote, McDaniel’s suspicions were echoed Wednesday by an unlikely ally: the chairman of the state’s Democratic Party. Many Democrats had hoped that a McDaniel victory might have created an unexpected opportunity by producing a weaker general-election nominee.

State Democratic Party Chairman Rickey Cole said he was “willing to bet a steak dinner” that at least one Democrat who participated in the June 3 primary was improperly allowed to vote Tuesday.

“I have no way of knowing how many more there are,” he said. “It’s somewhere between one and enough” to cast doubt on the result.

Cochran and other Mississippi Republicans have long sought to lure at least a portion of black voters in general-election campaigns. African Americans make up more than a third of the state’s electorate.

The push to draw blacks to the polls in a Republican primary was highly unusual. It appears to have been orchestrated largely by pro-Republican groups aligned with Cochran and groups connected to black political leaders and ministers.

Ads that ran in African American newspapers stressed Cochran’s support for historically black colleges, a medical facility that serves a heavily minority community in Jackson and the farm bill, which includes food-stamp funding.

“We’re asking Democrats to cross over and vote in the Republican primary to ensure our community’s interests are heard,” it read.

The ads were purchased by a newly formed group called All Citizens for Mississippi. The group shares a mailing address with a church whose pastor, Ronnie C. Crudup Sr., had publicly backed Cochran. Crudup could not be reached Wednesday.

Equally important was a stark message about McDaniel, a state senator and radio commentator who was backed by the tea party. His position on spending, which included a proposal to eliminate the Education Department, could devastate a state that heavily relies on federal funding.

And some of McDaniel’s rhetoric sounded nostalgic for a Mississippi history that is painful for many in the state, which marked the anniversary this week of the murder of three civil rights workers.

“We’re facing the 50th anniversary of the civil rights summer of ’64, and you don’t want someone in there who’s talking about taking things back another 50 years,” said Wardell Walton, 64, who served from 2005 to 2013 as the first black mayor of a city known for a time as “Bloody Belzoni” after the 1955 murder of a minister who sought to expand black voting rights.

The messages were repeated on radio stations that cater to black listeners and from the pulpits of black churches on recent Sundays.

Leading elected black Democrats such as Flaggs served as validators for Cochran, reassuring constituents who potentially were wary about voting for a Republican.

Brad Chism, an adviser to Democrat Travis Childers, who will face Cochran in November, said he received a recorded pro-Cochran phone call at his home on Tuesday from Credell Calhoun, a black Democrat who serves in the state House and used to work for the state party.

“The message was that Thad Cochran’s a moderate who’s made sure Mississippi gets its share of federal programs and who will stand between you and the tea party,” Chism said.

The effect was especially pronounced in Hinds County, the home of Jackson, where 70 percent of the residents are black. There, Cochran more than doubled his margin of victory Tuesday over the initial primary vote, besting McDaniel by nearly 11,000 votes in a race Cochran won by fewer than 6,700 votes.

“We know what the tea party is trying to do. So we weighed the field and concluded that with Cochran, we know what we’ve got and we like what we’ve got,” said Wayne McDaniels, president of the Jackson branch of the NAACP.

Cochran’s team on Wednesday sought to play down the impact of black voters and other Democrats on the senator’s victory.

The idea of a Republican relying on Democrats to win a party primary is a sensitive one in the conservative state, and Cochran aides said their efforts were targeted at picking up votes among Republicans.

“There were a tremendous number of people, black and white, who were panicked the day after the primary and felt guilty they didn’t vote,” said Stuart Stevens, a Cochran adviser.

He said the campaign scoured lists of June 3 primary voters for names of Republicans who usually vote but didn’t do so. “That became a universe that we worked over and over again.”

Tuesday’s results upended the hopes of national Democrats, who believed McDaniel could create a surprising opportunity for a pick-up in November.

But Mississippi Democrats who backed Cochran said they saw little chance for their party in November and feared electing McDaniel to the Senate.

“Mathematically, I didn’t see where it was going to happen,” Flaggs said. “And I didn’t want to take the chance.”

Scott Clement, Robert Costa, Magda Jean-Louis and Ed O’Keefe contributed to this report.