President Barack Obama has signed a $1.1 trillion bill that will fund nearly every federal government agency through 2015.
The only exception in the bill signed Tuesday is the Department for Homeland Security, which will run out of funding at the end of February.
Republican leaders limited funding for the agency so it can force Obama to reverse his executive order, which removes the threat of deportations from millions of undocumented immigrants in the United States.
The bill's final passage was thrown in doubt last week when Republican Senator Ted Cruz of Texas demanded a vote on a proposal to cut funds that could be used to carry out the president's executive order.
Congressional Democrats, led by Massachusetts Senator Elizabeth Warren, also threatened to scuttle the bill over a provision that weakens parts of the 2010 law regulating financial trading by major Wall Street firms.
Obama said last week that the bill includes provisions he does not like, but that there are other parts that ensure progress would continue on health insurance, climate change, early childhood education and job growth.
The bill's eventual passage and signing prevented another government shutdown like the one that occurred a year ago.
The funding legislation includes nearly $64 billion for military operations in Iraq and Afghanistan, as well as money in the fight against Islamic State militants, including the training and equipping of moderate Syrian rebels.