WASHINGTON—The U.S. budget deficit narrowed in February, leaving the country on track for its smallest budget deficit in six years.

The U.S. government's deficit for October through February totaled $377.38 billion, down 24% from the same period a year earlier, the Treasury Department said Thursday in its monthly report. The 2014 fiscal year started on Oct. 1.

Federal...