Updated 10:42 p.m. ET 9/30/2013
Washington (CNN) - Despite bitter partisanship that threatened a government shutdown, Congress actually managed to come together to pass one bill on Monday –unanimously, at that.
The Senate signed off on a House-approved measure to ensure members of the military would continue to get paid if congressional wrangling over spending and Obamacare resulted in a shutdown.
President Barack Obama signed the bill late Monday night.
"Those of you in uniform will remain on your normal duty status. The threats to our national security have not changed, and we need you to be ready for any contingency," he said in a video address that aired after midnight on Armed Forces Television. "If you're serving in harm's way, we're going to make sure you have what you need to succeed in your missions."
The law will shield lawmakers from having to explain why men and women on the front lines would not be paid with federal agencies spending less money or none at all, even as House and Senate members keep getting their checks.
Democrats who control the Senate initially said on Sunday they would not approve a separate bill for the military. But they changed their minds by Monday afternoon, and Majority Leader Harry Reid called for expedited passage.
Senate Republicans on Monday accused Reid of moving pre-emptively because he knew it would be "untenable," in the words of Sen. John Cornyn, R-Texas, not to have the military paid during a shutdown.
Several GOP senators wanted to force the issue in a series of floor speeches that were planned for just around the time Reid cleared the bill.
As it turns out, unanimous votes aren't all that rare on Capitol Hill. So far this year, there have been 36 pieces of legislation signed into law. All but a handful were passed with unanimous or near-unanimous support from both chambers.
Reid's decision on Monday even had Sen. Ted Cruz rising "in praise" of the majority leader.
"For everyone who thinks that compromise is impossible in Washington, I would point to this as an example," said Cruz, the Texas Republican who has led the charge against Obamacare in the Senate.
- CNN's Ashley Killough and Robert Yoon contributed to this report.