The Senate failed to approve a round of debate on the most recent attempt to fund the Department of Homeland Security, edging the agency closure to a shutdown.

The legislation needed 60 votes to move to debate in the Senate, but was rejected with 51 for to 48 against debate, effectively blocking the legislation from being considered.

The bill — passed by the House Jan. 14— boosts overall funding in fiscal 2015 by $400 million over 2014 levels. But the legislation also defunds many aspects of President Obama's recent actions on immigration, including a program that allows immigrant children to remain in the country.

Congress has already funded the rest of the government in December, but the DHS funding was cut short to provide an opportunity for further debate on immigration issues. The current continuing resolution for the agency expires at the end of February.

While most workers at the agency would continue to report for duty, they would not be paid if the agency shuts down.

Meanwhile Republicans, Democrats and administration officials have clashed over aspects of the bill, with Democrats and the White House arguing for a "clean" bill that does not contain the provisions regarding President Obama's executive actions.

The bill provides for 21,370 border patrol agents – a record high for the agency – as well as 23,775 Customs and Border Protection officers. DHS will also receive additional funding to test a biometric mobile application for people leaving the country.

The Secret Service would receive $1.7 billion – an increase of $80.5 million to help boost training and preparation efforts ahead of the 2016 presidential election.

But some agencies saw cuts. The Transportation Security Administration will see its budget cut by $94.3 million, and airport screening personnel would be capped at 45,000 employees.

The bill also requires DHS to submit comprehensive spending packages to Congress as well as report on its acquisition efforts.