Outside the federal courthouse in Richmond, the Republican said he was "deeply, deeply sorry" for the actions that led to his conviction on 11 felony public corruption charges, but that he "never, ever betrayed my sacred oath of office."
McDonnell and his attorneys vowed to appeal the convictions immediately.
The two years was a much shorter sentence than the 10 to 12 years that prosecutors had started the day asking for. But it was enough to rock McDonnell's children, family and friends, many of whom gasped as it was read and were left wiping away tears. When McDonnell left, his wife, Maureen McDonnell, who could face a similar sentence herself, remained in the courtroom, sobbing.
His sentencing was the culmination of the dramatic downfall of the Republican governor once heralded as a rising star -- tapped to give the party's 2010 rebuttal to President Barack Obama's State of the Union, and a fixture on short lists for national office.
Now, McDonnell has another distinction: He's the first Virginia governor ever sent to prison for corruption.
McDonnell pled on Tuesday for mercy, saying he is now a "heartbroken and humbled man."
His attorneys spent several hours ushering in a parade of political friends, religious leaders and family members to tout the Republican's good character -- and reading excerpts of more than 400 letters they'd submitted making the same case.
It wasn't enough to keep him out of prison entirely.
U.S. District Court Judge James Spencer delivered the sentence on Tuesday. His decision: In addition to 24 months in prison, McDonnell faces two more years of supervised release, as well as $1,100 in fines -- $100 for each of the 11 felonies for which he was convicted.
McDonnell was ordered to report to prison on Feb. 9, just before his wife's Feb. 20 sentencing.
It's Virginia's former first lady whose relationship with Richmond businessman Jonnie Williams, who provided the bribes that led to their convictions, has faced the most intense scrutiny in recent months. McDonnell's defense attorneys, allies and even one of the family's daughters pointed to New York shopping trips, New England vacations and more -- portraying a woman in love with the perks of power and a man too naive to say no.
That assessment, Spencer said, is "dangerously delusional."
"While Mrs. McDonnell may have allowed the serpent into the mansion, the governor knowingly let him into his personal and business affairs," the judge said.
In his comments to Spencer, McDonnell pled for leniency for his wife. Prosecutors wouldn't say Tuesday what penalty they'll seek for her.
McDonnell's attorneys had tried to keep the former governor from spending any time in prison. They argued instead for 6,000 hours of community service -- or about three years worth of volunteer work. They even offered specific ideas, like working with a religious organization to aid the poor in Haiti or managing a food bank that serves an impoverished section of rural Virginia.
Prosecutors, meanwhile, said that would amount to sweeping his crimes under the rug. The U.S. Probation Office had said federal sentencing guidelines suggested a sentence of 10 to 12 and a half years -- and prosecutors sought something in that range.
But McDonnell's attorneys convinced Spencer that the loans and gifts the former governor took from Williams were being overvalued, and Spencer knocked the sentencing guidelines down to 6 and a half to 8 years -- and still delivered a punishment short of that.
Spencer, a Ronald Reagan appointee, said he's spent decades trying to understand why seemingly good people do bad things -- but that McDonnell's crimes were too serious to ignore.
"This entire case has been tragic from beginning to end," Spencer said.
The courtroom was so packed with McDonnell's family members, friends, political allies and former staffers that federal officials had to feed video of the proceedings onto televisions set up in another courtroom -- and that one filled up, too.
Afterward, U.S. Attorney Dana Boente said getting prison time for McDonnell is a victory, and sends a warning shot to other politicians.
McDonnell, 60, was convicted in September of 11 felony public corruption charges. His wife, Maureen, was also found guilty on eight charges.
The charges were a result of the McDonnell family accepting about $177,000 in gifts and loans from Richmond businessman Williams. The trial was an emotional ordeal that often pitted McDonnell and other members of his family against his wife, who was portrayed as the driver of the family's connections with Williams.
The two were convicted of taking bribes from Williams in exchange for government favors as he sought to market a dietary supplement. The gifts included shopping trips with dress purchases in New York, wedding catering for the couple's daughter, golf outings for their sons, a Rolex watch and more -- the bills for which McDonnell's attorney, John Brownlee, said the former governor never knew were footed by Williams.
"We believe that these things were kept from Mr. McDonnell -- at least the source who paid for them," he said. Pointing to several of the individual trips and gifts, he argued that McDonnell should be sentenced for having taken $69,000 in inappropriate gifts and loans, rather than $177,000.
Afterward, Brownlee and fellow defense attorney Henry Asbill said the case hasn't reached its end.
"Sometimes in a case like this, justice is a marathon," Asbill said. "We will never give up this case."