A federal judge sentenced former Virginia governor Robert F. McDonnell to two years in prison Tuesday — an unexpectedly lenient punishment for a man who was convicted of selling the influence of his office to a wealthy benefactor for sweetheart loans, luxury vacations and even a Rolex watch.

Unless his case is overturned on appeal, McDonnell (R), who once was mentioned as a presidential contender, will become the first Virginia governor to go to prison.

Prosecutors had sought a 6 1/2 -year prison term, and sentencing guidelines called for as many as eight years and one month. But U.S. District Judge James R. Spencer’s decision ensured that McDonnell will be free before his 63rd birthday. Defense attorneys had asked for a sentence of 6,000 hours of community service.

“Unlike Pontius Pilate, I can’t wash my hands of it all,” Spencer said, after musing at length on the tragedy of the case. “A meaningful sentence must be imposed.”

He ordered McDonnell to report to prison by Feb. 9.

In preparation for Robert McDonnell’s sentencing, here’s a look at sentences other politicians have faced in similar cases in recent years.

The sentence brings to a close a stunning narrative of politics, greed and family drama that reached a climax in September when McDonnell and his wife, Maureen, were convicted of public corruption. A jury found unanimously that the couple used the governor’s office to help Jonnie R. Williams Sr., a wealthy dietary supplement company executive, advance his business interests and that, in exchange, Williams gave the McDonnells $177,000 in loans and gifts. Maureen McDonnell is scheduled to be sentenced Feb. 20.

Tuesday’s emotional, hours-long hearing began with a last-minute appearance from Maureen McDonnell and ended with an impassioned plea for mercy from the former governor. As the sentence was read, McDonnell’s family members cried softly, and Robert McDonnell stood with no visible reaction — a stark contrast to four months ago, when he collapsed sobbing upon hearing that he had been convicted.

Afterward, McDonnell — who has been living apart from his wife — gave Maureen McDonnell a peck on the cheek; she remained in the courtroom crying after her husband and his legal team left. Outside the courthouse, McDonnell clasped the hands of two of his daughters and vowed to appeal the case — saying he “never, ever betrayed my sacred oath of office” and that his “ultimate vindication” would come from Jesus Christ.

“I am a fallen human being,” he said. “I’ve made mistakes in my life.”

The arguments about McDonnell’s punishment ranged from the technical to the intangible, contrasting the former governor’s character with the crimes of which he was convicted. In his statement, McDonnell asked the judge that “whatever mercy you might have, you grant it first to my wife, Maureen.” That was a notable sentiment because some McDonnell supporters — and even, to a degree, his defense — blamed the former first lady for getting the family involved with Williams.

Spencer spoke for nearly 15 minutes, addressing the fairness of the trial, the history of U.S. sentencing laws and the sadness of the case. He tipped early on that he disagreed with federal sentencing guidelines — which, by his calculation, called for a term between 6 1/2 years and eight years and one month — calling the punishment the guidelines recommended “ridiculous, under these facts.” But he was also critical of McDonnell’s conduct and that of some of his supporters.

Spencer twice mentioned the governor’s wife. At one point, he called those who claimed she roped the governor into the case “dangerously delusional.” Later, he said, “While Mrs. McDonnell may have allowed the serpent into the mansion, the governor knowingly let him into his personal and business affairs.”

Former Virginia governor Robert F. McDonnell has been sentenced to two years in prison. Here’s a look at the corruption case against McDonnell, by the numbers. (Julie Percha/The Washington Post)

U.S. Attorney Dana J. Boente said after the hearing that Spencer “gave a good explanation” for his thinking. He said in a statement that he hoped the “investigation, prosecution and sentence will help restore and maintain the high integrity of the governor’s office, while affirming our commitment to prosecuting public officials who commit crimes.”

Adam Lee, the FBI special agent in charge of the Richmond field office, said that “any prison time for an elected official is punishment.”

Spencer gave defense attorneys wide latitude to make their case that McDonnell’s long history of public service and good character had earned him a measure of leniency. They put 11 witnesses on the stand who said McDonnell was a compassionate and empathetic official who cared little for material goods, rather than the greedy, entitled politician prosecutors had claimed him to be. A few offered specific community-service work assignments that they said would be preferable to McDonnell’s spending time in prison.

Virginia House Speaker William J. Howell (R-Stafford), a longtime friend, said McDonnell’s predicament had already served as a deterrent to other state lawmakers. McDonnell’s sister Nancy McDonnell Naisawald said her brother had trouble eating after his conviction and lost weight.

“It’s been an absolutely devastating experience for our family,” she said.

The highlight came as former Virginia governor L. Douglas Wilder (D) took the stand and insisted that McDonnell could have been on the shortlist for president of the United States if not for the case. He sparred with Assistant U.S. Attorney Michael Dry, drawing applause from a courtroom packed with McDonnell supporters when he noted the “progenitor of the bribe” — Williams — “walks away clear.” Prosecutors had given Williams broad immunity in exchange for his testimony against McDonnell.

In his own pitch, Dry — who had initially asked for a sentence of more than 10 years but adjusted his request downward after legal arguments Tuesday — asserted that McDonnell had shown no remorse and continued to blame others, including his wife. He noted that “nobody elected Jonnie Williams to anything” and said that people like the businessman “are a dime a dozen.”

“Corrupt governors are not, thankfully,” he said.

Dry spoke about the public’s general distrust of politicians and said McDonnell’s malfeasance stood in a category all its own.

“These crimes are unprecedented in Virginia’s 226-year history,” Dry said.

Defense attorney Henry Asbill argued that McDonnell was a unique defendant — a man of such high moral fiber that hundreds of people had written letters on his behalf. Asbill read excerpts from many of the letters, choking up as he pleaded for a lenient sentence for his client. McDonnell himself asked to be spared prison.

“I stand before you a heartbroken and humbled man,” McDonnell told Spencer. “I’m now 60 years old. All of the additional days that the Lord allows me . . . I dedicate them to the service of others.”

Spencer said he was moved particularly by McDonnell’s service in the Army and that he struggled to understand — in all cases — why good people ended up as defendants. He noted McDonnell’s many supporters, asking rhetorically, “Why would you take these kinds of chances?” In the end, he said he could not ignore the fact that a jury had convicted the former governor.

“The jury by its verdict found an intent to defraud,” Spencer said. “This is a serious offense that all the grace and mercy that I can muster, it cannot cover it all.”

It was the chef at Virginia’s executive mansion who first brought McDonnell’s relationship with Williams to the attention of authorities. In the spring of 2012, Todd Schneider was accused of stealing food from the mansion’s kitchen. In response, he turned over documents revealing that Williams had paid $15,000 for the food at the wedding of McDonnell’s daughter — an event the chef had catered.

State authorities began looking into whether McDonnell had properly disclosed Williams’s gifts and loans, while federal investigators began exploring whether Williams had committed security violations. In 2013, those investigations merged, as Williams turned on McDonnell and told federal prosecutors that he had been bribing the governor to obtain help with his company’s fledgling dietary supplement.

Williams had taken the first lady on a shopping spree in New York City for clothes worth more than $20,000 and bought a $6,500 Rolex watch for the governor, at her request. He took the couple on a pricey Cape Cod vacation and let the McDonnell family stay at his vacation lake home. Most significant, he gave $120,000 in undocumented loans to Maureen McDonnell and a small real estate company owned by Robert McDonnell and his sister.

In exchange, the jury found, McDonnell helped Williams as he attempted to get his supplement, Anatabloc, studied at state universities, setting up meetings for the businessman, allowing him to launch the product with a party at the governor’s mansion and letting him shape the guest list for a party of important health-care leaders.

McDonnell was in the final year of his four-year term when news broke of his financial entanglements with Williams in 2013. At the time, he had just ushered a bipartisan plan to improve state roads through the Virginia General Assembly, the state’s economy was brightening and his public approval numbers were sky-high.

But much of the last months of his tenure was consumed with dealing with the scandal. He apologized for his actions in July 2013 but maintained that he had committed no crime.

McDonnell and his wife were indicted jointly in January 2014, 10 days after he left office and Gov. Terry McAuliffe (D) was sworn in as his successor. McAuliffe said in a statement that the sentencing “brings an end to one of the most difficult periods in the history of Virginia state government.

“Like many Virginians, I am saddened by the effect this trial has had on our Commonwealth’s reputation for clean, effective government,” McAuliffe said. “As we put this period behind us, I look forward to working with Virginia leaders on both sides of the aisle to restore public trust in our government.”

Sen. Timothy M. Kaine (D-Va.) on Tuesday called again on Virginia’s General Assembly to tackle “significant ethics reform” and said McDonnell’s sentencing “seems to be the end of the chapter in some ways.”

McDonnell’s attorneys requested that he be assigned to a federal prison in Petersburg, which is just south of Richmond; prison officials will pick a spot for him in the coming weeks. The former governor has also asked that he be allowed to remain free while his appeals are adjudicated — although Spencer had yet to rule on that matter Tuesday.

“Sometimes in a case like this, justice is a marathon,” said Asbill, McDonnell’s defense attorney. “We will never give up in this case.”

Ed O’Keefe and Laura Vozzella contributed to this report.