Congress on Thursday approved a $1.1 trillion spending bill that keeps the government running through September – and stands as President Trump’s first major piece of legislation.

The Senate passed the bill 79-18, a day after the House approved it.

The bill now heads to the White House for Trump’s signature with plenty of time left to dodge a midnight Friday deadline.

The passage came moments before the House also voted to approve a Republican-authored health care bill, in a major victory for the White House and majority party.

The spending bill includes $15 billion more for the Pentagon and $1.5 billion in emergency border security funds but does not include funding to begin construction work on the president’s southern border wall with Mexico.

Democrats who negotiated the bill with Republicans successfully defended other accounts targeted by Trump such as foreign aid, the Environmental Protection Agency, support for the arts, and economic development grants, among others.

The sweeping, 1,665-page bill also increases spending for NASA, medical research, and federal law enforcement agencies like the FBI.

Trump took to Twitter earlier this week to complain about the bipartisan process that produced the measure but changed course to crow about additional spending for the military and border security. The White House has said he'll sign the bill.

One of Trump's tweets advocated for a "good shutdown" this fall to fix the "mess" that produced the bill, though he appeared at the White House just hours later to boast that it was a big win for him.

Congressional Republicans -- motivated in great measure by fear of a politically damaging government shutdown -- worked closely with minority party Democrats to produce the measure, which made only small changes to most accounts covered by the measure.

But many rank-and-file Republicans saw the bill as a lost opportunity for a fight that could have produced victories on the wall and punishing "sanctuary" cities that fail to cooperate with immigration authorities.

"It is a win for Democrats and a loss for conservatives," said tea party Rep. Dave Brat, R-Va. "We have a Republican in the White House and control of both chambers of Congress yet this legislation fails to include key conservative reforms Republicans have long-advocated."

The Associated Press contributed to this report.