Mr Edwards said he had told his wife of the affair and asked for forgiveness
Former Democratic US presidential hopeful John Edwards has admitted that he had an extra-marital affair and that he lied about it during his campaign.
Mr Edwards, whose wife has terminal cancer, said the affair in 2006 was with a film-maker whose company made documentaries for his campaign.
He denied fathering Rielle Hunter's child, born in February, but said he was willing to take a paternity test.
He confessed to the affair in an interview with US broadcaster ABC News.
The admission followed reports of the sex scandal in the National Enquirer newspaper, which Mr Edwards had previously dismissed as "tabloid trash".
In a statement released following his television appearance, Mr Edwards said he had made "a serious error in judgment".
"I started to believe that I was special and became increasingly egocentric and narcissistic," Mr Edwards said, trying to explain his behaviour.
He said he was "ashamed" of his actions, and that he had informed his wife about the affair in 2006 and had asked for her forgiveness, the statement said.
Elizabeth Edwards later released her own statement, in which she confirmed that her husband had told her of the affair and that she had hoped it would remain private.
She described the affair as "a terrible mistake", and said that coming to terms with it had been "a long and painful process".
Mr Edwards said his affair with Rielle Hunter in 2006 was short-lived
But she added that the healing process was "oddly made somewhat easier" when she was diagnosed with breast cancer in March 2007.
Mrs Edwards said she was proud of her husband despite his shame, and she asked that her family's privacy be respected.
"Now the truth is out, and the repair work that began in 2006 will continue," she said.
Rielle Hunter's daughter was born in February this year, and no father's name was given on the birth certificate.
Mr Edwards told ABC that his affair had ended too soon for him to have been the father.
Correspondents say the revelations could affect John Edwards' chances of receiving a post in government if Democrat Barack Obama wins the presidency in November.