The U.S. budget gap widened 39% in the first five months of the fiscal year as tax revenues held steady and federal spending increased.

The government ran a $544 billion deficit from October through February, the Treasury Department said Friday, compared with $391 billion during the same period a year earlier. Federal outlays rose 9%, to $1.8 trillion, while revenues declined less than 1%, to $1.28 trillion.

Part...