Image caption Elizabeth Edwards, shown here last year, first became ill in 2004

Elizabeth Edwards, the wife of former presidential candidate John Edwards, has died after a battle with breast cancer, a family spokesperson has said.

Mrs Edwards' doctors announced on Monday that further treatment would be unproductive and that she might only have months to live.

Mr Edwards and his wife separated in January after revelations he had fathered a child during an affair.

Mr Edwards ran for the Democratic presidential nomination in 2008.

Mrs Edwards, 61, was first diagnosed with cancer in 2004. The disease then went into remission until the 2008 presidential campaign.

Mr Edwards declined to withdraw from the race until effectively forced out by Hillary Clinton and Barack Obama months later.

'She knew tragedy and pain'

"Today we have lost the comfort of Elizabeth's presence, but she remains the heart of this family," her family said in a statement.

"We love her and will never know anyone more inspiring or full of life. On behalf of Elizabeth, we want to express our gratitude to the thousands of kindred spirits who moved and inspired her along the way. Your support and prayers touched our entire family."

Elizabeth revealed a kind of fortitude and grace that will long remain a source of inspiration US President Barack Obama

US President Barack Obama said he spoke to John Edwards and his daughter Cate on Tuesday afternoon to offer condolences.

"In her life, Elizabeth Edwards knew tragedy and pain," said Mr Obama in a statement.

"Many others would have turned inward; many others in the face of such adversity would have given up. But through all that she endured, Elizabeth revealed a kind of fortitude and grace that will long remain a source of inspiration."

'Living with hope'

Mrs Edwards had thanked her supporters on her Facebook page on Monday.

"The days of our lives, for all of us, are numbered," Mrs Edwards wrote.

She added that she had found that "living with hope, and in the daily effort to have a positive impact in the world, the days I do have are made all the more meaningful and precious".

Mrs Edwards, who endured a media frenzy about her husband's infidelity while battling cancer, wrote two best-selling books called Resilience and Saving Graces about her illness and her marriage.

She died in the US state of North Carolina at 1015 (1515 GMT) on Tuesday, according a friend of the family quoted by the Associated Press.

Mrs Edwards' family asked that donations be made to the Wade Edwards Foundation - an organisation established in honour of the Edwards' son who died in a car accident when he was 16-years-old.