(AP Photo/J. Scott Applewhite)

The federal government would have run a $270 billion surplus in fiscal 2015 had federal spending merely returned to the level it was in fiscal 2008—the last fiscal year before President Barack Obama took office.

That is according to the official spending and revenue numbers published by the Treasury.

In fiscal 2008, according to the Treasury, the federal government brought in $2,523,642,000,000 in revenue and spent $2,978,440,000,000. It thus ran a deficit of $454,798,000,000.

In fiscal 2015, the government brought in a record $3,248,723,000,000 in revenue. That is $270,283,000,000 more than the $2,978,440,000,000 that the government spent in fiscal 2008.

But the federal government did not limit its spending to $2,978,440,000,000 in fiscal 2015. Instead it spent $3,687,622,000,000.

So, instead of having the surplus of $270,283,000,000 that it would have had in fiscal 2015 had it only spent as much as it spent in fiscal 2008, the government ran a deficit of $438,899,000,000.

Similarly, the federal government would have run a surplus of $41,931,000,000 in fiscal 2014—when it brought in $3,020,371,000,000 in revenue--had it held spending to the $2,978,440,000,000 level of fiscal 2008. Instead, the government spent $3,503,732,000,000 in fiscal 2014 and ran a deficit of $483,361,000,000

Had the government increased spending from 2008 to 2015 only by the rate of inflation, the federal deficit would have been much smaller.

The $2,978,440,000,000 the federal government spent in 2008 equals $3,291,662,940,000 in 2015 dollars, according to the Bureau of Labor Statistics inflation calculator.

Had the federal government spent only $3,291,662,940,000 in fiscal 2015—instead of $3,687,622,000,000—the record $3,248,723,000,000 in revenue that the Treasury took in fiscal 2015 would have covered all but $42,939,940,000 in federal spending.

That $42,939,940,000 deficit would have been less than one-tenth the $438,899,000,000 deficit the government ended up running.

Back in fiscal 2000, the year before President George W. Bush took office, the federal government brought in $2,025,060,000,000 in revenue and spent $1,788,143,000,000, according to the Treasury. That yielded a surplus of $236,917,000,000.

Had spending been frozen at the 2000 level of $1,788,143,000,000 for the next seven years, the tax revenues that the Treasury brought in during those years would have caused a surplus in every year but 2003--when revenues were $1,782,317,000,000.

However, with actual federal spending increasing every year from fiscal 2001 through 2007, the Treasury only recorded a surplus in fiscal 2001 ($127,276,000,000).

In fiscal 2002 and every year since then, the federal government has run a deficit.

In fiscal 2015, according to the Treasury, the Department of Health and Human Services accounted for the largest share of federal outlays. It spent $1,027,422,000,000. The Social Security Administration was the second largest spender with $944,143,000,000. The Defense Department finished a distant third with $562,506,000,000.