John Edwards has completed one of the most spectacular falls in US politics in the last decade: from leading contender in the 2008 Democratic presidential race to being indicted for channelling campaign funds to hide his girlfriend.

He was accused of improperly spending $927,000 (£564,000) to keep her and their baby out of sight during his White House bid.

Edwards, 57, appeared in court in Winston-Salem, North Carolina, and denied charges of conspiracy, illegal campaign contributions and lying.

He told reporters afterwards: "There is no question that I have done wrong. I take full responsibility for having done wrong. I will regret for the rest of my life the pain and the harm that I have done, but I did not break the law and I never, ever thought I was breaking the law."

He had to surrender his passport and was ordered to remain in the US.

Edwards, who was John Kerry's vice-presidential running-mate in 2004, was one of three strong candidates for the presidential nomination in 2008 along with Barack Obama and Hillary Clinton.

He fought the campaign mainly on an anti-poverty platform, but part of his appeal was his presentation of himself as a family man, apparently devoted to his wife, Elizabeth, who had cancer. Disclosure of his affair with Rielle Hunter, whom he met in a New York bar in 2006 and who joined his campaign team, would have destroyed his chance of getting voted to the White House.

The indictment says: "Edwards knew that public revelation of the affair and the pregnancy would destroy his candidacy by, among other things, undermining Edwards' presentation of himself as a family man and by forcing his campaign to divert personnel and resources away from other campaign activities to respond to criticism and media scrutiny regarding the affair and pregnancy."

He is accused of conspiring with others to "falsify, conceal and cover up by trick, scheme and device a material fact", causing the John Edwards for President Committee "to create and file false and misleading campaign finance reports".

The court case comes after a two-year grand jury investigation, based in Raleigh, North Carolina, into the use of more than $40m raised by Edwards during the campaign. The indictment claims that $725,000 contributed by Rachel "Bunny" Mellon, the 100-year-old widow of a banking heir, and $200,000 from the late Fred Baron, a wealthy trial lawyer, was used to pay for Hunter's hotel bills, chartered aircraft, a car, furniture, a house rented in Santa Barbara, California, and other living costs.

The indictment says that Edwards asked Andrew Young, one of the campaign staff, to pretend, falsely, that Hunter's child was his.

The indictment claims that cheques to Edwards by one of the contributors were falsely listed as being for chairs, a book case and an antique Charleston table.

It lists spending on Hunter on 24 December 2007 as $29,259 for a chartered flight from Florida to Colorado, $25,283 at the Four Seasons Hotel, Santa Barbara, on 10 January 2008 and $58,667 rental payment on a house in Santa Barbara on 14 January 2008.

Edwards could, in theory, face jail but election law in the US is complex and his lawyers are likely to say the money was a personal gift, not campaign funds.

He was at the outset of the 2008 campaign seen as a genuine contender, portraying himself the working-class boy made good. But he was squeezed out by Obama and Clinton in Iowa, New Hampshire and South Carolina.

The supermarket tabloid the National Enquirer reported in October 2007, just months before the Iowa caucus, that he had an affair with a staffer but the mainstream media, sceptical of the report, largely ignored it. Edwards described the story as ridiculous. "I've been in love with the same woman for 30-plus years," he said.

He admitted late in 2008 to having had an affair but said he was not the father of the child. He admitted in 2009 that the child was his. His wife died last year.