WASHINGTON (Reuters) - The U.S. budget deficit widened to $587 billion for the fiscal year 2016 on slower-than-expected revenues and higher spending for programs including Social Security and Medicare, the Treasury Department said on Friday.

Slideshow ( 2 images )

The 2016 deficit increased to 3.2 percent of gross domestic product.

It was the first time the deficit increased in relation to economic output since 2009, according to figures from the Congressional Budget Office. That year, the deficit peaked at $1.4 trillion amid the financial crisis.

Last fiscal year’s deficit was $439 billion, with a deficit-to-GDP ratio of 2.5 percent. Accounting for calendar adjustments, the 2016 fiscal year deficit was $548 billion.

Fiscal 2016 revenues grew 1 percent to $3.267 trillion, while outlays rose 5 percent to $3.854 trillion.

Revenue growth was reduced by the retroactive extension of some expired individual and corporate tax deductions passed by Congress as part of the Protecting Americans from Tax Hikes (PATH) Act late last year, Treasury said.

With an aging population, mandatory spending for Social Security and Medicare, the federal retirement and healthcare programs for the elderly, have increased.

For September, the Treasury posted a $33 billion budget surplus, a 63 percent decline from the same month last year.

Analysts polled by Reuters had expected a $25 billion surplus for last month.

When accounting for calendar adjustments, September would have shown a $75 billion surplus compared with an adjusted $91 billion surplus in the same month a year ago.

Receipts last month totaled $357 billion, a 2 percent decline from September 2015, while outlays stood at $323 billion, an 18 percent rise from the same month a year ago.

The non-partisan Congressional Budget Office has repeatedly warned that increasing federal debt levels are unsustainable over the long term unless Congress changes current laws.