WASHINGTON (Reuters) – The U.S. government’s deficit widened to $120 billion in July, fueled by increases in spending on health care and the military, according to data released on Monday by the Treasury Department.

The size of the deficit was in line with expectations in a Reuters poll of analysts.

The Treasury Department said federal spending in July was $371 billion, up 23% from the same month in 2018, while receipts were $251 billion, up 12% compared with July 2018.

The fiscal-year-to-date deficit was $867 billion, compared with $684 billion in the comparable year-earlier period.

The U.S. government’s fiscal position has deteriorated since 2016, hit by an aging of the population that has led to more people drawing on Medicare, a federal health insurance program for the elderly.

Increased spending on the military has also fueled the deficit under President Donald Trump, who took office in January 2017 promising to strengthen the military.

Earlier this month, the U.S. Congress passed a two-year budget deal backed by Trump that would increase federal spending on defense and other domestic programs, which could significantly add to the government’s growing debt.

In July, Washington spent $53 billion on defense programs, up from $43 billion in the same month of 2018. Spending on Medicare rose to $66 billion from $34 billion, though some of that increase was because of calendar adjustments, a Treasury official said.

When adjusted for calendar effects, the U.S. government’s deficit last month was $129 billion compared with an adjusted deficit of $122 billion in July 2018, the Treasury official said.

Even accounting for the calendar adjustments, spending on Medicare rose 11 percent in July compared to the same month a year earlier.

(Reporting by Jason Lange; Editing by Paul Simao)