The United States posted its first April deficit in 26 years, a record $20.91 billion shortfall as a deep recession caused revenues to collapse in the year's biggest tax collection month, the U.S. Treasury said on Tuesday.

The deficit, the first for April since a $3.3 billion gap in 1983 as the country emerged from a deep recession, was largely in line with forecasts from Wall Street economists polled by Reuters.

It brought the deficit for the first seven months of fiscal 2009 to a record $802.29 billion after a major positive accounting adjustment for the government's bailout investments.

Instead of following the previous practice of treating investments from the Treasury's Troubled Asset Relief Program as cash outlays, the Obama administration has shifted to net present value accounting for them, a method that assumes they have value that the government will one day recoup.

The change reduced the deficit for the first six months of fiscal 2009, which started in October, by about $175 billion, a Treasury official said. The new net present values are baked into the April TARP outlay data.

Receipts for April, normally the year's biggest revenue month due to the April 15 deadline for federal income tax filing, fell to $266.23 billion from $403.75 billion in April 2008. Both individual and corporate income tax payments fell sharply from a year earlier.

But outlays set another April record, rising to $287.14 billion from $244.47 billion a year earlier.

These outlays included $11.5 billion in purchases of mortgage-backed securities from Fannie Mae and Freddie Mac that the Treasury has undertaken to help reduce mortgage rates and aid recovery of the depressed housing market. In March, the Treasury purchased $17.4 billion in mortgage-backed securities from the two home finance companies.

The April outlays also included $3.2 billion in direct TARP outlays and a $1.2 billion reduction in TARP financing costs due to modifications of bailouts for American International Group and Citigroup -- essentially the conversion of preferred shares to common equity.

(Reporting by David Lawder, Editing by Leslie Adler)