When the votes were counted late Saturday, the results were what many thought from the get-go: Democratic John Bel Edwards will face Republican David Vitter in a November runoff to determine Louisiana’s next governor.

A cheer went up at Vitter’s Kenner watch party shortly before Public Service Commissioner Scott Angelle told supporters in Lafayette, “We came up a little short.”

Their fellow Republican, Lt. Gov. Jay Dardenne, trailed far behind.

The contest was a lot closer than what was predicted early on, when the four main candidates attended cordial, policy-driven forums. It ended with a rash of attack ads and a focused onslaught against Vitter that helped chip away at the U.S. senator’s once overwhelming lead over his two Republican opponents.

About 38 percent of the state’s 2.9 million voters cast ballots on a rainy election day. It’s one of the lowest turnouts in years. only slightly more than the 36.9 percent who voted in the 1998 U.S. Senate primary and a little more than voted in 2011, when Gov. Bobby Jindal won re-election against a field of relative unknowns.

As the main Democratic Party champion, Edwards — a state representative from Amite who is House minority leader — was long expected to win a spot in the runoff. Democrats can still deliver a large block of votes, even if the party hasn’t been able to elect one of its own to statewide office since 2008.

Edwards said he expects to come under attack from Vitter, who focused his most negative ads on Angelle and Dardenne in the primary.

“This is going to be a real tough runoff to watch unfold on TV,” Edwards said, noting that he has run no negative ads in the campaign.

Edwards took heavy aim at his runoff opponent in his speech, drawing cheers from the crowd.

“David Vitter wouldn’t last five minutes at West Point,” said Edwards, a West Point graduate and military veteran, drawing cheers from the crowd. “He’s desperate, and all he offers are lies.”

When Vitter was introduced at his own election night speech, the fired-up crowd chanted “David! David! David!”

He didn’t wait long to give them the red meat they wanted to hear.

“Voting for John Bel Edwards would be like voting for Barack Obama to be governor of Louisiana,” he said. “The good news is that we can chart a very different path.”

Vitter blamed “Baton Rouge politicians” for the state’s problems, even though Jindal is a Republican, and Republicans hold a majority in both houses of the Legislature.

Edwards received 40 percent of the vote — far ahead of projections. Vitter had 23 percent. The two other GOP contenders split much of the remaining vote, with Angelle polling about 19 percent and Dardenne receiving about 15 percent.

That the vote totals were so close is a surprise.

Vitter garnered 57 percent of the vote when he won re-election to the U.S. Senate in November 2010.

As little as 90 days ago, Vitter, of Metairie, was predicted to walk away with a spot in the runoff election. He is universally known among Louisiana voters. Back in July, he had raised more money than his opponents put together, and polls found he had overwhelming support.

But in the waning days of the campaign, Vitter saw those numbers slip as voters were relentlessly reminded of his 2007 admission that he had committed an unspecified sin and had asked for forgiveness. His statement came after his phone number was found among the records of a call-girl service.

Also, a faction of Louisiana Republicans, whom Vitter had alienated over the years, began asserting themselves. That number would include Jefferson Parish Sheriff Newell Normand, who on Friday arrested a Dallas private investigator he said was suspected of illegally spying on a breakfast the sheriff was having with friends, a group that included Republican state Sen. Danny Martiny, of Metairie. The investigator works for a Texas firm that showed up on Vitter’s campaign finance reports.

Vitter may have lucked out with two other GOP candidates in the race, at least so says Dardenne, of Baton Rouge.

Although a lot of conservative voters are attracted to Vitter’s pugnacious style, many voters flat don’t like him. “If it was just me or just Scott, this race would have been over two weeks ago,” Dardenne said Thursday.

The campaign was long — forums for the major candidates began in January — and short. Television commercials, many of them making particularly nasty and often exaggerated claims, didn’t start dominating the airwaves until late September.

The Center for Public Integrity found that the nearly $15.8 million spent on TV campaign advertising in this year’s elections was more than any other state. That calculated to about $4.70 for every potential voter.

Vitter aired nearly twice as many ads as Angelle, of Breaux Bridge, who had the second-most ads.

Nine candidates sought to replace Jindal, who has to step down after two terms in office and is now running for the GOP presidential nomination. All four of the major candidates sharply criticized the unpopular Jindal and spoke of the need to change several of his policies.

Both Vitter and Edwards said they would call a special session of the Legislature to tackle budget problems inherited from the Jindal years and to roll back many of the tax giveaways the governor used as incentives for economic development. But few were willing to be specific.

Edwards’s stances against abortion and for gun rights put him at odds with his party.

But Edwards also favors a higher minimum wage and would immediately expand the rolls of Medicaid, the government insurance program that pays health care costs for the poor, to include working adults who make too much to qualify but too little to purchase adequate coverage on the private market.

A Roman Catholic from the small town of Amite, Edwards graduated from the U.S. Military Academy at West Point and commanded an 82nd Airborne Division before returning to Louisiana to become a lawyer. His family has been in law enforcement for generations — his father was sheriff of Tangipahoa Parish when he grew up, and his brother is sheriff now.

Vitter is considered the more conservative than Edwards, though that is narrow in Louisiana politics.

He has an A+ rating — the highest — from the National Rifle Association and the endorsement from the National Right to Life Committee, the country’s largest anti-abortion group.

His confrontational and dogmatic style endears him to conservative Christians, tea party members and others on the far right. His “anti-Washington” rhetoric morphed into “anti-Baton Rouge” as Vitter, a politician for nearly a quarter-century, tried to paint his opponents as bureaucrats.

Vitter rarely appears in uncontrolled public situations. He prefers instead “town hall” meetings, where the questions are vetted in advance, and closed-door meetings with officials. He attended few forums and only two televised debates. His campaign often, but not always, cited Vitter’s work in Washington as the reason.

However, Vitter did speak at Southern University in May, addressing several dozen people, few of whom could be expected to support him. “Voters don’t trust government, and as a voter, I get that,” Vitter said. “I’m running, not to kick the can down the road, not to play politics with the big issues.”

A New Orleans-born Roman Catholic, Vitter has degrees from Harvard and Oxford University, where he was a Rhodes scholar. He then earned a law degree from Tulane University in New Orleans and worked as an attorney before entering politics. His wife, Wendy, is a former prosecutor.

Tyler Bridges, Elizabeth Crisp, Will Sentell and Marsha Shuler, of The Advocate Capitol news bureau, contributed to this report. Follow Mark Ballard on Twitter, @MarkBallardCNB. For more coverage of government and politics, follow our Politics Blog at http://blogs.theadvocate.com/politicsblog/