The federal government ran a lower deficit this July than a year ago, keeping it on course to record the lowest deficit in six years.

The July deficit was $94.6 billion, an improvement of 3.1 percent from a year ago, the Treasury Department reported Tuesday in its monthly budget statement.

For the first 10 months of this budget year, the deficit totals $460.5 billion, down 24.2 percent from the same period a year ago.

The Congressional Budget Office expects this year’s deficit to total around $500 billion, down from $680.2 billion last year. That would be the lowest deficit since an imbalance of $458.6 billion in 2008, which was a record at the time.

The Great Recession and efforts to deal with the financial crisis sent deficits above $1 trillion for four straight years.

The July imbalance followed a $70.5 billion surplus in June, a month when government coffers are swelled by quarterly tax payments. But without the quarterly payments, the government ran a deficit in July, a month when it has recorded deficits in 58 of the last 60 years.

The yearly deficit peaked at $1.4 trillion in 2009 and remained above $1 trillion for each of the next three years, finally falling to $680.2 billion last year.

CBO projects the deficit will fall to $469 billion in 2015 before starting to rise again, topping $1 trillion annually starting in 2023. Spending on the government’s major benefit programs, including Social Security and Medicare, will drive those increases as more baby boomers retire.

For the first 10 months of the current budget year, which began in October, government revenue totaled $2.47 trillion, up 8 percent from the same period a year ago, reflecting a stronger economy that has boosted employment and led to rising income tax revenues and higher corporate tax payments.

With two months left in the current budget year, government spending is up 1.2 percent to $2.93 trillion, compared to a year ago, reflecting government efforts to restrain outlays in an effort to get control of the budget deficits.

Republicans have accused President Barack Obama of failing to propose significant cuts to reduce soaring entitlement costs. Democrats counter that Republicans would rather impose sharp cuts on needed government programs than impose higher taxes on the wealthy.

Neither side is expected to make major concessions in this congressional election year.

But the budget wars of the past three years have subsided at least for a brief time. An agreement was reached in December on the broad outlines for spending over the next two years.

The agreement will allow Washington to avoid the gridlock that culminated in October’s 16-day partial shutdown of the government.

The budget cease-fire also includes legislation that suspended the government’s borrowing limit through March 15 of next year. That puts off another battle over raising the debt ceiling until a new Congress takes office in January.