The U.S. budget posted a rare January surplus, largely reflecting a big boost in tax revenue, the Treasury Department said Tuesday.

The federal budget surplus for the month was $2.88 billion, compared with a deficit of $27.41 billion the previous January. That was the first January surplus since 2008.

The surplus helped narrow the deficit for the first four months of the government's fiscal year, which began Oct. 1, to $290.42 billion from $349.14 billion during the same period a year earlier, Treasury said in its monthly report.

The report showed January receipts jumped about 16% to $272.23 billion. That reflected several factors, including an increase in employees' payroll tax rate to 6.2% from 4.2%, due to the expiration of a temporary cut in the rate. The Congressional Budget Office estimates that change increased the government's revenue in January receipts by about $9 billion.

Other factors included big dividend payouts or other compensation made at the end of last year in anticipation of higher tax rates in 2013. Those payments could have created tax bills that came due in January.