It’s a rags-to-riches story that Gov. Terry McAuliffe loves to tell.

"When I became governor, I inherited a large deficit," McAuliffe, a Democrat, said during a Nov. 2 interview on MSNBC’s "Hardball With Chris Matthews." "You know what? We just turned that into the largest surplus in Virginia history."

He made similar statements during Aug. 26 and Oct. 28 interviews on WTOP radio in Washington and in a July 9 speech to the Metropolitan Washington Council of Governments. And during a July 21 interview on WRVA radio in Richmond, McAuliffe added some details.

"I did announce a nice surplus the other day - $553 million," the governor said. "I remind you, when I became governor I inherited a $2.4 billion deficit. It wasn’t my budget, I wasn’t even governor yet, and we worked in a bipartisan way to work that out."

We decided to fact-check McAuliffe’s claim, wondering how he could have inherited a deficit from his predecessor, Republican Gov. Bob McDonnell, when the state constitution requires a balanced budget. We examined the two elements in the governor’s full statement: 1) that he inherited a deficit and, 2) that it was turned into a record surplus.

The inheritance

Virginia has a two-year budget cycle. Prior to the start of the first year, the legislature approves and the governor signs a biennial plan. After that, the governor and lawmakers negotiate budget amendments based on the needs and finances at the time. The state constitution requires that total expenditures not exceed revenues at the end of the two-year period.

McDonnell, in one of his last acts as governor, presented two budget bills to the General Assembly on Dec. 16, 2013.

The first bill put his finishing touches on the outgoing two-year budget, set to expire June 30, 2014. The proposal, called the "caboose budget," anticipated $35.4 billion in general fund revenues for the budget cycle and $34.9 billion in expenses.

The second bill was McDonnell’s proposal for the coming two-year budget, which began July 1, 2014. He anticipated almost $37.8 billion in general revenues and proposed $37.7 billion in spending.

In other words, when McAuliffe took office on Jan. 11, 2014, McDonnell left two balanced budget bills sitting on his desk. So why does McAuliffe say he "inherited a large deficit?"

Brian Coy, a McAuliffe spokesman, noted that the state’s economy slowed that winter and spring, causing tax revenues to fall below expectation. The McDonnell administration "left behind a budget that had a forecast that was too optimistic for our financial situation," he told us. "They supported a spending threshold that was too high."

Does that mean McDonnell should have seen the economic slowdown coming? "With the benefit of hindsight, some signs could have been detectable and some may have not," Coy said.

The slowdown was caused by two factors:

•Tax cuts ushered in by former President George W. Bush expired in 2013 and the capital gains tax rose. As a result, there was a surge of people cashing in capital assets before the new rates took effect, followed by a lull after the levy went up. The lull caused a steep decline in non-withholding tax receipts in Virginia in 2014.

•Federal spending cuts hurt Northern Virginia, the state’s largest economic engine.

McAuliffe sensed the problems shortly after taking office, but he underestimated their severity. On Feb. 12, 2014, he reduced the revenue estimate in the coming two-year budget McDonnell proposed by $140 million. "Although our underlying economic forecast has not changed," McAuliffe said , "it is clear that the current revenue receipts warrant attention."

In May, the shortfall exploded to an estimated $1.5 billion. The General Assembly and McAuliffe that month agreed to a new two-year budget going into effect July 1 and patched the revenue hole by making about $800 million in spending cuts and drawing $700 million from the state’s rainy day fund.

Seven months into his term, on Aug.15, 2014, McAuliffe estimated the shortfall at $2.4 billion and ordered additional cuts to keep the new two-year budget balanced. In a speech to the General Assembly’s money committees, the governor said that out of caution, his forecast was deliberately "pessimistic."

The surplus

The second part of McAuliffe’s statement is that the shortfall was "turned" into the "largest surplus in Virginia history." That stems from McAuliffe’s announcement in July 2015 that Virginia ended the first year of its biennial budget $550 million in the black.

The figure slightly outstrips the previous surplus high of $545 million for the budget year that ended in mid-2005, according to records going back to 1990. But it should be noted that when adjusted for inflation, the 2005 surplus still is the highest.

Some people hearing McAuliffe’s statement might conclude that Virginia’s budget has made almost a $3 billion rebound during the last year - from a $2.4 billion shortfall in 2014 to a $550 million surplus this year. That’s not the case.

McAuliffe and the legislature overestimated the state’s economic problems in August 2014 when they adjusted the two-year budget to a "pessimistic" forecast of a $2.4 billion shortfall. That assumption turned out to be $550 million too high and produced the record surplus McAuliffe cites.

Our ruling

McAuliffe said, "When I became governor, I inherited a large deficit. … We just turned that into the largest surplus in Virginia history."

The simple fact is that McAuliffe inherited balanced budget proposals from McDonnell. Perhaps, as the governor’s spokesman suggests, McDonnell should have seen approaching clouds and proposed a more conservative spending plan. But that’s hindsight and financial projections are tricky. When McAuliffe sensed an economic slowdown during his first weeks in office, he made a modest $140 million cut to McDonnell’s revenue forecast. Six months later, McAuliffe was projecting a $2.4 billion shortfall.

McAuliffe is hardly the first governor to accuse his predecessor of leaving behind a financial mess. But evidence shows the brunt of the economic slowdown, though not McAuliffe’s fault, occurred during his watch.

This year’s $550 million surplus is a state record in terms of raw dollars, although not in inflation-adjusted dollars. But the surplus does not mean there’s been a record turnaround in Virginia’s economy. It means that the revenue shortfall is turning out not to be as steep as projected in 2014.

On the whole, we rate McAuliffe’s statement Mostly False.