The economy may be plodding along. But business is booming for Uncle Sam.

The Treasury Department said on Thursday that the federal budget deficit for the first half of the 2014 fiscal year totaled $413 billion, down $187 billion from where it stood at this point last year, as tax revenue surged and spending sank.

In March, the Treasury collected $216 billion in taxes, up 16 percent from a year ago, helping reduce the deficit for the month to $37 billion, from $107 billion last year. Spending also sank by 14 percent, or $40 billion.

The budget gap last month was the smallest deficit recorded for the month of March since 2000, when economic growth was running at a much faster pace than it is today.

The red ink had been expected to ease this year. But Thursday’s announcement underscored just how quickly tax receipts have been increasing as economic growth speeds up and the stock market surges.