"Just signed the bill. Our military will now be stronger than ever before. We love and need our military and gave them everything - and more. First time this has happened in a long time. Also means JOBS, JOBS, JOBS," Trump said in a tweet.
The Republicans took the support of House Democrats to clear the bill with 240-186 votes, CNN reported.
Trump said that without more Republicans in the Senate, his administration had to increase spending on things it did not like or wanted to "take care of the military".
"Sadly, we needed some Democrats votes for passage. Must elect more Republicans in 2018 election."
The colossal bill, which lawmakers have been negotiating for months, would be a game-changing piece of legislation, clearing the decks for Congress in dealing with major spending issues as well as doling out disaster relief money.
"Costs on non-military lines will never come down if we do not elect more Republicans in the 2018 election, and beyond. This bill is a BIG VICTORY for our Military, but much waste in order to get Democrat votes. Fortunately, DACA not included in this Bill, negotiations to start now!"
The bill also does not address the high-profile issue of immigration, a key sticking point for many Democrats; but increases spending caps by $300 billion for the Pentagon and domestic priorities, a crucial incentive for getting enough votes from both parties.(ANI)