Correction: A previous version of this article incorrectly said that Robert F. McDonnell testified that his wife felt "tense" about becoming first lady. He said she experienced "tension." This version has been corrected.

Former Virginia governor Robert F. McDonnell took the stand at his federal corruption trial Wednesday and began laying out the narrative that will shape his defense — that he did nothing more for a dietary supplement company and its chief executive than he would have for any other state business.

The 71st governor of Virginia began his much-anticipated testimony on the afternoon of the trial’s 18th day, swearing to tell the truth just like the 59 witnesses before him and even spelling, for the record, his last name.

[Follow our Day 19 liveblog for the latest]

Then, the former state attorney general, House delegate and Army officer began trying to convince jurors that they should not convict him of public corruption.

There will probably be no more important moment in the trial; legal experts say McDonnell’s testimony over the coming days will determine in large part whether he and his wife end up in federal prison. He spent just short of two hours testifying Wednesday — mostly outlining his biography and values before he began addressing the specific allegations against him and his wife, Maureen.

List of gifts given to the McDonnell family from Jonnie Williams.

McDonnell’s appearance on the stand was historic: He is the first Virginia governor ever to be charged with or tried for a crime. It also underscored a spectacular fall for a man who, less than a year ago, governed Virginia from his perch on Capitol Square, just a few blocks down Broad Street from the federal courthouse.

Back then, McDonnell (R) was introduced as “his excellency” and people stood when he entered the room. Now defendant McDonnell, 60 years old, stands for the judge and jury.

The McDonnells are charged with lending the prestige of the governor’s office to Richmond businessman Jonnie R. Williams Sr. and his dietary supplement company, Star Scientific, in exchange for $177,000 in loans, vacations and luxury goods. Jurors have seen in person the medley of gifts McDonnell and his family received — a presentation that experts say will be difficult for the former governor to overcome.

But McDonnell wasted little time advancing the heart of his defense Wednesday — that he gave Williams nothing other than routine access to government. The former governor said he was eager to promote all Virginia businesses and believed, at least for a time, that Star Scientific might create jobs in the commonwealth.

Jurors have heard testimony that McDonnell asked state officials to take meetings with Williams and other Star Scientific executives. McDonnell testified that he frequently directed his Cabinet secretaries and staffers to sit down with people who wanted assistance from government.

Jurors have also heard that McDonnell allowed Star Scientific to hold an event at the governor’s mansion timed to coincide with the launch of its new dietary supplement and that Williams was later allowed to invite doctors he wanted to impress to another event. McDonnell said he held hundreds of functions at the mansion and encouraged as many people as possible to visit the historic home.

“I would say things like meetings and mansion events . . . I certainly viewed those as the mere basic routine access to government and not unusual,” he said. He insisted that he had done “very little” for the company beyond providing the kind of constituent service available to donors and non-donors alike.

Sketches of former Virginia governor Robert F. McDonnell at the defense table in court in Richmond. (Richard Johnson/The Washington Post)

When McDonnell first took the stand, his voice quivered, and he talked quickly. All the jurors stared intently, initially captivated by the man whose fate they will decide.

As McDonnell described his biography, he grew more confident. He often looked directly at jurors and gestured with his hands. A few times, he looked over at his wife — notable because defense attorneys have said their marriage was so broken that they could not have conspired together as prosecutors allege.

McDonnell began to lay the foundation for that aspect of his defense, too, although he did not fully pull back the curtain on his troubled marriage, as defense attorneys said he will Thursday.

McDonnell said that when, early in his career, he became a local prosecutor, his wife was “a little surprised, maybe disappointed” by his salary. He said that the day after he was elected governor in 2009, his wife yelled at him. She appeared to experience “tension” about becoming first lady and fretted over what she would wear that day.

“I could tell she was not as happy as I was,” he said.

That tale was punctuated by what happened next. McDonnell said he told his wife that he had to take some phone calls, and he noticed a 202 number. He answered.

“Can you hold for the president of the United States?” said the voice on the other line.

McDonnell said he and Barack Obama, who introduced himself by his first name, talked for about seven minutes about the need for them to work together. McDonnell said it was “an experience I won’t forget.”

“It was now dawning on me I was in a new phase in my life,” McDonnell said.

The domestic troubles, though, continued. A Virginia Commonwealth University management consultant testified Wednesday that in early 2012, after observing the first lady’s anxiety, he advised the governor to have his wife move out of the mansion or perhaps seek counseling. The governor responded that he simply needed to spend more time with his wife, the consultant testified.

“He listened. He heard that,” said James Burke, the consultant. “But he said he needed to take responsibility for a problem he caused.”

McDonnell spent much of the afternoon describing how he ascended to the governor’s office — starting with years spent in the Army and then his decision at 31 to leave a good job at a hospital supply company and go to law school.

After a brief stint as a prosecutor, he was elected to the House of Delegates in 1991. He then ran successfully for attorney general and finally, in 2009, for governor. As recently as 18 months ago, he was considered a viable presidential candidate for the 2016 election.

One of the things he told jurors that helped fuel that rise: campaign donations.

McDonnell estimated that over the past eight years, he had raised $58 million for campaigns, including during his 2012 service as chairman of the Republican Governors Association. Persuading donors to part with their money is a major part of the political process, he said.

Over that time, he testified, he developed a general philosophy for dealing with donors. “My rule of thumb is every contributor wants something,” he said. But, he added, “if you can’t take somebody’s money and be willing to vote against their interests the next day, you don’t belong in the business.”

He said he made no distinction between people who made campaign contributions and those who gave him personal gifts. Such assistance, he said, did not play a role in his decisions about policy.

McDonnell provided for the jury a series of examples of donors and gift-givers whose requests he denied, including Virginia Beach Mayor William Sessoms Jr., whose bid to join the board of Old Dominion University was turned aside. Sessoms testified earlier in the trial about loans McDonnell held with a bank that the mayor leads.

“You’ve got to be able to separate the receipt of a contribution from what you believe is the right thing to do on a particular policy issue,” McDonnell said. “You’ve got to know where those lines are.”

Along with his legal team, McDonnell left the courthouse with two longtime friends who had served as character witnesses for him earlier in the day. One of them, a Catholic priest, reiterated for reporters that McDonnell was a man of strong moral character.

Then someone turned to the former governor and asked, “How did you get yourself into this mess?”

“Well,” McDonnell said, “we’ve got a couple more days to talk about that.”

Steve Hendrix, Robert Samuels and Rachel Weiner contributed to this report.