US Trade Deficit
Containers being unloaded at a dock. REUTERS

The U.S. federal deficit for this fiscal year has contracted unexpectedly and sharply -- by 25 percent -- as medical costs stopped growing at previous rates, higher taxes boosted revenue and the economy slowly improved.

The amount by which federal government spending in the 12 months ending Sept. 30 will exceed its receipts during that period will shrink by $642 billion, the Congressional Budget Office said Tuesday. The CBO also said that such a deficit, which is about 4 percent of anticipated gross domestic product (GDP), is the smallest shortfall since 2008.

The CBO said that automatic budgets cuts this year, also known as the sequester, have cut short-term government spending. Further, big dividend payments from Fannie Mae and Freddie Mac, the two government housing financing agencies that control nearly all new home mortgages, this year will boost government receipts.

By 2015 the federal budget deficit, as a percentage of the GDP, will decline to 2.1 percent, the CBO said. After that, however, the deficit will resume its long-term growth.

"Budget shortfalls are projected to increase later in the coming decade, reaching 3.5 percent of GDP in 2023, because of the pressures of an aging population, rising health care costs, an expansion of federal subsidies for health insurance, and growing interest payments on federal debt," the CBO said.