FILE PHOTO: The U.S. Capitol building reflected in water at sunrise on the day of the U.S. midterm election in Washington, U.S., November 6, 2018. REUTERS/Jim Bourg/File Photo

WASHINGTON (Reuters) - The U.S. federal government posted a $160 billion budget surplus in April, according to data released on Friday by the Treasury Department.

Analysts polled by Reuters had expected a $165 billion surplus for the month. The surplus was $214 billion in April 2018.

The Treasury said federal spending in April was $375 billion, up 27% from the same month in 2018, while receipts were $536 billion, up 5% compared with April 2018.

Treasury said both receipts and outlays were records.

When adjusted for calendar effects, the surplus in April was $158 billion versus $169 billion the prior April.

The deficit for the fiscal year to date was $531 billion, compared with $385 billion in the comparable period the year earlier. The adjusted results showed the deficit at $533 billion in the current fiscal year and $434 billion in the prior period.