The House on Friday passed a waiver that will let retired Gen. James Mattis serve as Defense secretary, clearing the path for his confirmation despite a swift rise in Democratic opposition this week.

The House voted 268-151 on the waiver. Thirty-six Democrats voted in favor of the waiver, while one Republican, Rep. Justin Amash Justin AmashOn The Trail: How Nancy Pelosi could improbably become president History is on Edward Snowden's side: Now it's time to give him a full pardon Trump says he's considering Snowden pardon MORE (Mich.), voted against it.

The Senate on Thursday voted 81-17 to pass the waiver.

The White House said President Obama will sign the bill if Congress passes it before he leaves office. "I think you can anticipate that if it did make it to the president’s desk that he will sign it," White House press secretary Josh Earnest said at a briefing Friday.

ADVERTISEMENT

Mattis needs a waiver because of a law that says Defense secretaries must be out of uniform for at least seven years, a measure intended to preserve civilian control of the military. Mattis retired in 2013.

Prior to this week, little opposition existed in either party to the waiver. But President-elect Donald Trump Donald John TrumpBarr criticizes DOJ in speech declaring all agency power 'is invested in the attorney general' Military leaders asked about using heat ray on protesters outside White House: report Powell warns failure to reach COVID-19 deal could 'scar and damage' economy MORE's transition team did not allow Mattis to testify before the House Armed Services Committee after Mattis himself had told the leaders of the committee he would.

The cancellation angered House Democrats, who refused to vote for the waiver without Mattis’s testimony.

Democrats argued that voting for the wavier without Mattis’s testimony is setting a precedent for Trump to treat Congress as irrelevant.

“Here we are, before this president is even in office, at the very first opportunity, he is choosing to completely ignore us for no reason,” said Rep. Adam Smith David (Adam) Adam SmithWhen 'Buy American' and common sense collide Overnight Defense: Marine Corps brushes off criticism of Marines' appearance in GOP convention video | US troops injured in collision with Russian vehicle in Syria | Dems ask for probe of Vindman retaliation allegations Democrats press Pentagon watchdog to probe allegations of retaliation against Vindman brothers MORE (D-Wash.), ranking member of the House Armed Services Committee.

“No good reason. You cannot tell me Gen. Mattis could not handle an hour and half’s worth of questioning in the House Armed Services Committee. He’s done it before, countless times.”

Democrats are also concerned the waiver does not exempt Mattis from the Uniform Code of Military Justice, which retired officers are subject to for life. As such, Mattis could theoretically be court-martialed by Trump.

“When you’re taking about civilian control of the military, if you have a retired military officer who is still subject to military law, that without question blurs the line between him being the military officer and him being a civilian,” Smith said.

The only time the law has been waived, for George Marshall in 1950, the waiver exempted Marshall from the military code.

Republicans, too, were unhappy at the canceled hearing, but said the waiver needed to be passed so that Mattis can be confirmed soon after Trump enters office and formally nominates him.

“There are legitimate complaints about the president-elect’s transition team refusing to allow Gen. Mattis to come to a hearing and testify before the House,” said Rep. Mac Thornberry (R-Texas). “I share all of those concerns. I think it was a mistake and shortsighted.”

But, Thornberry said, “we have a responsibility to the men and women who serve and I think we have a responsibility for the safety and security of every American to see that there is a fully functional secretary of Defense on day one of the new administration.”

Updated at 4:19 p.m.