WASHINGTON — The United States government ran a much higher budget deficit in July than a year ago, but it is still on track for the lowest full-year deficit in eight years.

The Treasury Department said on Wednesday that the July deficit totaled $149.2 billion, compared with a deficit of $94.6 billion a year earlier. The deterioration stemmed mainly from the fact that Aug. 1 fell on a Saturday. As a result, the government paid out $42 billion in August benefits in late July instead.

Through the first 10 months of this budget year, the deficit stood at $465.5 billion, 1.1 percent higher than a year ago. The outlook for the full year looks more promising. The Congressional Budget Office estimates that the year-end total will drop to around $425 billion, making it the lowest deficit since 2007.

The expected improvement this year reflects a strengthening economy, with tax revenue rising as more people find jobs and the government pays out less in unemployment benefits.