The House voted 257 to 167 to fund the Department of Homeland Security through the end of fiscal year 2015 – averting the looming threat of a partial agency shutdown.

Congress had already funded the rest of the government in December, but the DHS funding was cut short to provide an opportunity for further debate on President Obama's executive actions, including a program that defers deportation for immigrant children and others.

Lawmakers had clashed on legislation that would have prohibited the administration from implementing President Obama's executive orders on immigration, with legislation stalling before Congress passed a one-week extension Feb. 27. DHS funding was set to expire March 6.

President Obama is expected to sign the bill.

The funding legislation provides $39.7 billion in discretionary funding – a $400 million increase over 2014 levels. The bill also provides a total of $753.2 million for cybersecurity operations in the National Protection and Programs Directorate.

It also funds 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 will see 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.

× Need a daily brief? We've got you covered. Sign up to get the top federal headlines each morning. Thanks for signing up. By giving us your email, you are opting in to the Daily Brief.

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