John Edwards and a former speechwriter, Wendy Button, outside the federal courthouse in Greensboro, N.C., on Tuesday.Credit
Chuck Burton/Associated Press

GREENSBORO, N.C. — In August 2009, with a grand jury investigating former Senator John Edwards and the public still unclear about whether the affair he admitted to a year earlier had indeed produced a child, he struggled with how to finally tell the truth.

To do that, he turned to Wendy Button, 43, his longtime speechwriter, who had drafted speeches for Hillary Rodham Clinton and Barack Obama when they were in the Senate. At the heart of the conversations between Ms. Button and Mr. Edwards, and at the heart of this trial, is whether Mr. Edwards knew more than he now claims about the money used to cover up the affair. According to Ms. Button’s testimony on Tuesday, he did.

Reading from a series of spiral notebooks that she used to record hours of intimate conversations with Mr. Edwards, Ms. Button recounted for a federal jury here how the two practiced for potential questions from reporters, weighed how much to say about who paid to hide the affair and how badly a statement would harm his family.

His wife, Elizabeth, who was struggling with cancer, had written a memoir earlier that year that discussed the affair, but did not mention the baby girl even though she had known about her since August 2008. She did not want Mr. Edwards to claim paternity publicly.

Mr. Edwards, who was somber in the courtroom on Tuesday and at times wiped his eyes, listened to Ms. Button recount how shocked she had been when she learned in the summer of 2008 that rumors of the affair were true, but how she had believed him when he said that an aide, Andrew Young, was the father.

Within a year, she would discover that that was a lie. And then she would become the person Mr. Edwards turned to in an effort to make it right with his supporters and the public. When Mr. Edwards started working with her to write the statement, he told her that he had wanted to tell the truth for nearly a year, but “things were difficult inside his house that made it difficult for him to do this,” Ms. Button told the court.

First and foremost, she said, Mr. Edwards wanted to make a public declaration to Frances Quinn Hunter, the girl he fathered with the campaign videographer Rielle Hunter and then distanced himself from by having Mr. Young claim paternity. “He had denied her publicly, and he needed to embrace her publicly,” Ms. Button testified.

Mr. Edwards suggested this language: “I made a mistake, she is not,” Ms. Button recalled.

Ms. Button said she continued over a series of days to coax Mr. Edwards to be completely honest. They debated how to best present the statement and practiced how he would answer questions from reporters.

If they asked why did he do it, he would answer, “I didn’t think I would get caught.”

If they asked why he lied about it, especially in a national TV interview? “To protect my family.”

Do you love Ms. Hunter? “Yes. It’s complicated.”

Is the affair still going on? “You’re not entitled to all the details.”

An error has occurred. Please try again later.

You are already subscribed to this email.

The one thing that did not sit right with Ms. Button, she said, was his statement about the money, the very thing for which Mr. Edwards is on trial.

He faces six counts of conspiracy and campaign finance violations. At issue is whether nearly $1 million from two wealthy donors was used to influence his run at the 2008 Democratic presidential nomination or, as he contends, was a gift from friends to help hide the affair from his wife.

Early in their discussions in the summer of 2009, Ms. Button said, Mr. Edwards told her that he had known all along that Fred Baron, his former campaign finance chairman and a Texas billionaire, had taken care of Ms. Hunter and Quinn as they went on the run with Mr. Young and his family. Mr. Edwards’s lawyers have emphasized that he did not know about this money.

Nor, the lawyers have said, did he know the extent to which money from Rachel Mellon, an heiress, had helped finance the cover-up. Mrs. Mellon, 101, had given more than $6 million to his campaigns and causes, and an additional $725,000 secretly through Mr. Young to care for Ms. Hunter. Earlier testimony showed that Mr. Young had kept much of that money to build a dream house.

Mr. Edwards told Ms. Button that because gift taxes had been paid on the money and because he was a private citizen, he did not think he would be charged.

But how to work that into the statement? Mr. Edwards first suggested saying, “While I never asked my friend Fred Baron for a dime, I stood by while he supported my daughter. And I will reimburse his wife.” Mr. Baron died in 2008. As they worked on the statement back and forth by e-mail, Mr. Edwards said the lines about Mr. Baron and the money needed to be taken out for “legal and practical purposes,” Ms. Button said.

By this time, late in the summer of 2009, Ms. Hunter had spent nine hours in front of a grand jury. Mr. Young, too, had been called to appear. Charges against Mr. Edwards seemed imminent.

It made Ms. Button uncomfortable. “There I was, typing a lie,” she told the court.

In the end, the line would be erased from the statement, which would not be issued until January 2010.

A version of this article appears in print on May 9, 2012, on Page A15 of the New York edition with the headline: Speechwriter Recounts Edwards’s Decision to Come Clean About Child From Affair. Order Reprints|Today's Paper|Subscribe