A U.S. Dollar note is seen in this June 22, 2017 illustration photo. REUTERS/Thomas White/Illustration

WASHINGTON (Reuters) - The U.S. government posted an $8 billion budget deficit in June, according to data released on Thursday by the Treasury Department.

Analysts polled by Reuters had expected a $6.35 billion deficit for the month.

The Treasury said federal spending in June was $342 billion, down 12% from the same month in 2018, while receipts were $334 billion, up 6% compared with June 2018.

The deficit for the fiscal year to date was $747 billion, compared with $607 billion in the comparable period the year earlier.

When adjusted for calendar effects, the deficit for June was $55 billion compared with an adjusted deficit of $30 billion in June 2018. Calendar adjustments had little effect on the year to date figures.