The federal deficit rose to $782 billion for fiscal year 2018, the Congressional Budget Office estimated Friday, the largest shortfall since 2012.

The deficit easily eclipsed 2017's $666 billion. At just under 4 percent of gross domestic product, the fiscal year 2018 deficit marked the third straight year that the deficit increased as a share of the economy.

The deficit grew in 2018 because revenues were about flat while spending rose 3 percent, acording to the CBO.

The CBO, Congress' nonpartisan group of budget experts, anticipates that the government's finances will only deteriorate in the years ahead. It expects the annual deficit to rise to $981 billion next year, or about 4.6 percent of GDP, and then eclipse the $1 trillion mark the year after that.

The deficit is the difference in one year between spending and revenues. Accumulated deficits increase the debt.

The total federal debt held by the public is currently around 76 percent of GDP. The CBO expects the debt to rise to around 96 percent of GDP in the next decade, in absence of major congressional changes to taxes and spending.