The saga over the looming partial government shutdown continued on Friday after Congress passed a stopgap bill that will keep the Homeland Security Department running for another seven days.

Following a dramatic and chaotic day on Capitol Hill, both branches of Congress approved a one-week extension of the Department of Homeland Security funding bill late Friday to prevent the agency from shutting down at midnight. The bill was then signed into law by President Obama.

The Senate approved the measure in a 68 to 31 vote, while the House voted 357-60 to continue funding the DHS.

At the center of the fight over funding the DHS is a rider that blocks Obama's executive order to prevent the deportation of 5 million undocumented workers currently living in the U.S. The battle over immigration, however, has divided congressional Republicans since some want to hold the DHS hostage in order to pass their agenda, while others say the effort to kill Obama's plans through the funding bill is futile.

"There are terrorist attacks all over world, and we're talking about closing down Homeland Security. This is like living in world of crazy people," tweeted Republican Rep. Peter King, a former chairman of the Homeland Security Committee.

Other GOP members, like Rep. Mo Brooks of Alabama, have taken a hardline approach against funding the bill.

"I am not going to vote under any circumstances to fund illegal conduct," Brooks said. "If it's illegal, it's illegal."

Some rank-and-file members acknowledged that the stopgap bill is just a short-term fix and that Congress will take up the same fight in one week.

"I don't think there is any middle ground," said Republican Rep. Tom Rooney. "I think you either vote to shut Homeland Security down or you vote to allow the president to continue forward with the executive action."

Meanwhile, Democrats want to pass a standalone, full-year funding bill without adding an immigration provisions.