GREENSBORO, N.C. - A former speechwriter for John Edwards testified Tuesday that the onetime presidential candidate acknowledged knowing that a wealthy donor was secretly supporting his pregnant mistress as he sought the White House in 2008.

Wendy Button testified at Edwards' corruption trial that she helped him in the summer of 2009 to draft a public statement admitting he had repeatedly lied about fathering a baby girl with his mistress, Rielle Hunter.

Button said Edwards told her that he knew his campaign-finance chairman, Fred Baron, had been financially supporting Hunter and the baby.

"He said he knew that Fred had been taking care of things all along but that he didn't know the details," Button said.

That admission was absent from the statement Edwards eventually released in January 2010 saying that he was the father of the baby, Frances Quinn Hunter. Button said Edwards told her to remove the sentence about his knowledge of the money flowing to his mistress, citing "legal and practical reasons" it should not be included. At the time, it was well-known that federal prosecutors were investigating the money used to cover up Edwards' affair.

Edwards has denied knowing about nearly $1 million in secret payments provided by Baron and another wealthy donor, the 101-year-old heiress Rachel "Bunny" Mellon. He has pleaded not guilty to six criminal counts related to campaign-finance violations.

Button said Edwards told her in 2009 he had only recently learned about the $725,000 in checks Mellon provided to a fund-raiser for Edwards.

That staff member, Andrew Young, then spent some of the money to rent a house for Edwards' mistress, buy her a BMW, and pay medical bills. Financial records made public during the trial also show Young and his wife kept most of the money, which they spent building their family's dream home

Button said Edwards told her in 2009 that Young had "extorted" the money from Mellon without his knowledge. Edwards told her he did not think he would be charged with any crime because of what his aide had done.

Button said Edwards told her the money was legal because the donors had paid gift taxes and he was no longer an elected official as he campaigned for president. Edwards served one term in the U.S. Senate that had expired in January 2005.