WASHINGTON -- The U.S. Senate passed a $1.1 trillion spending bill after a 24-hour logjam prompted by opposition to moving nominations. The vote removes the possibility of a government shutdown until October 2015. President Barack Obama is expected to sign it quickly.

The bill passed the Senate 56-40, with both bipartisan support and opposition.

The bill doesn’t fund the Department of Homeland Security, which retains the possibility of being shut down if Congress doesn’t again pass funding for the agency before Feb. 27. The move not to fund DHS is part of a Republican strategy to try to pressure Obama to reverse executive orders in which he granted legal status to about 5 million undocumented immigrants.

The Senate finished voting just after 10 p.m. Saturday in a rare weekend session. It was preceded by 10 hours of procedural votes on nominations, which Majority Leader Harry Reid forced while the spending bill was tied up by procedural opposition.

It was a long slog for the spending bill, which faced bipartisan opposition both in the House and Senate.

The final hurdle was a move by Sen. Ted Cruz, R-Texas, to force a vote on its constitutionality. Cruz argued because the spending measure will fund the execution of Obama’s executive orders, it’s unconstitutional.

“Tonight, is the first opportunity that Congress has to express its disapproval,” Cruz said in calling for the vote.  “Tonight both Democrats and Republicans will have the opportunity to show America whether they stand with the president who is defying the will of the voters or with the millions of Americans who want a safe and legal immigration system.”

The move was largely political theater. It was clear that there wouldn’t be enough votes to actually block the legislation. But Cruz’s insistence that the vote be taken caused a nearly 24 hour delay in allowing a vote on the bill and kept the Senate in an unusual Saturday night session.

But Cruz failed to get enough support to actually cause problems for the bill. The vote on his constitutional point of order failed 74-22, with only Republicans voting with Cruz.

Cruz wasn’t the only one unhappy with the legislation. A handful of liberal Democrats and conservative Republicans joined forces to voice their opposition to a provision in the bill that will roll back some Wall Street regulations that were included in the Dodd-Frank law.

Massachusetts Sen. Elizabeth Warren led the liberal wing of the opposition. A progressive darling, Warren has said many times she’s not interested in running for president. But when she took to the floor to blast the Dodd-Frank provision, she only served to inflame her supporters.

She failed to convince her leadership to allow a vote on an amendment to eliminate the Dodd-Frank provision. Doing so would have almost certainly caused a government shutdown because the House had already left town for the holidays.

Earlier in the week, it appeared the spending bill was going to move through Congress quickly after a bipartisan, bicameral group negotiated its content. But it first hit problems in the House where six hours of last-minute negotiations Thursday and phone calls from the president finally ensured passage.