WASHINGTON (Reuters) - The U.S. budget deficit widened to $666 billion for the fiscal year 2017 as record spending more than offset record receipts, the Treasury Department said on Friday.

The U.S. Treasury building is seen in Washington, September 29, 2008. REUTERS/Jim Bourg

The 2017 deficit increased to 3.5 percent of gross domestic product. The previous fiscal year deficit was $586 billion, with a deficit-to-GDP ratio of 3.2 percent.

The latest fiscal year, which ended Sept. 30, straddled the presidencies of Barack Obama, a Democrat, and Donald Trump, a Republican.

Accounting for calendar adjustments, the 2017 fiscal year deficit was $644 billion compared with $546 billion the prior year.

Fiscal 2017 revenues increased 1 percent to $3.315 trillion, while spending rose 3 percent to $3.981 trillion.

Since taking office in January, the Trump administration has sought to overhaul the U.S. tax code with precise details currently being worked on in Congress.

The Republican tax plan currently calls for as much as $6 trillion in tax cuts, which would sharply reduce government revenues.

It has prompted criticism that it favors tax breaks for business and the wealthy and could add trillions of dollars to the deficit. The administration contends tax cuts will pay for themselves by boosting economic growth.

In addition to the annual deficit, the national debt - the accumulation of past deficits and interest due to lenders to the Treasury - now exceeds $20 trillion.

The non-partisan Congressional Budget Office has said the ever-rising debt levels are unsustainable as the government pays for the medical and retirement costs of the aging Baby Boomer generation.

For September, the U.S. government recorded an $8 billion surplus, a 76 percent drop from the same month last year. Economists polled by Reuters had forecast the Treasury reporting a $6 billion surplus last month.

When accounting for calendar adjustments, the surplus last month was $61 billion compared with an adjusted surplus of $73 billion the prior year.

A senior Treasury official said outlays last month were a record for the month of September. Outlays were $341 billion, up 5 percent from the same month a year earlier while receipts totaled $349 billion, down 2 percent from one year ago.