Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The U.S. government posted an unexpectedly large budget surplus in June, a further sign of the rapid improvement in public finances that has taken the heat off Congress to find savings and raise the nation's borrowing limit.



Rising tax revenue, public spending cuts and big payments to the Treasury from government-backed mortgage companies helped the government take in $117 billion more last month than it paid out, the U.S. Treasury said on Thursday.

Analysts polled by Reuters had expected a surplus of $39.5 billion.

June's surplus was the largest on record for that month.

While the government is still $510 billion in the red with three months to go in the fiscal year, June's big surplus will buy it time before it runs up against the limit on borrowing set by Congress. Analysts expect the Treasury to hit the debt ceiling by early November.

The surplus in June also highlighted how much an improving economy and existing legislation have helped improve the fiscal outlook. That has made overhauling public pension and healthcare systems a little less pressing.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Rising incomes and tax increases enacted earlier in the year helped cause government receipts to rise to $287 billion in June, up 10 percent from a year earlier. While economic growth has been lackluster in the first half of 2013, job growth has been more steady. In June, 195,000 jobs were added to the nation's non-farm payrolls.

Across-the-board budget cuts that began in March also contributed to the surplus.

Gross outlays at the Department of Defense and for military programs, for example, are down about 7 percent in the fiscal year to date from the same period a year earlier. The current fiscal year began last October.

Government-backed mortgage companies Fannie Mae and Freddie Mac , which were bailed out by taxpayers during the financial crisis but have since returned to profitability, also helped drive June's surplus by pouring billion of dollars into public coffers.

Fannie Mae, which said in May it would return $59 billion to the Treasury in quarterly dividends, provided most of the funds. The big dividend payment reflected an extraordinary gain from the reversal of a tax-related writedown.

More business news:

Follow NBCNews.com business onTwitter and Facebook