The federal campaign-corruption case against former Senator John Edwards is over.

The Justice Department said Wednesday it would not retry Mr. Edwards on the five charges of campaign finance fraud on which a North Carolina jury could not reach a verdict after a six-week trial that ended this month. The jury acquitted him on a sixth.

Although ostensibly a legal case concerned with how a candidate can use money from political supporters, the trial became a spectacle of personal details that cost both sides millions in legal fees.

The trial mined deeply personal details of Mr. Edwards’s affair with Rielle Hunter, a videographer whom he hired to help with his presidential campaign after meeting her in a New York bar. Ms. Hunter became pregnant with their child, and the couple’s efforts to hide the relationship from the public and from Mr. Edwards’s wife, Elizabeth, were at the heart of the government’s case.

Two wealthy friends offered more than $1 million to pay for those efforts, and the government accused Mr. Edwards of fraud, arguing that the money was used to influence voters in his bid for the 2008 Democratic presidential nomination.