WASHINGTON — The House on Friday unanimously passed bipartisan legislation that would allow consumers to “unlock” their cellphones when switching providers.

The chamber’s approval comes a week after the Senate passed the bill, so it advances to the president’s desk with a few working days left before Congress’ August break.

President Obama applauded Congress for passing the pro-consumer legislation and is expected to sign the act into law.

“The bill Congress passed today is another step toward giving ordinary Americans more flexibility and choice, so that they can find a cellphone carrier that meets their needs and their budget,” Obama said in a statement.

Work on the Unlocking Consumer Choice Act began after more than 100,000 people signed a White House petition to reverse a 2012 U.S. Copyright Office ruling that made it illegal for people to unlock their phones without the carrier’s permission.

“This is something that Americans have been asking for and I am pleased that we were able to work together to ensure the swift passage of legislation,” House Judiciary Committee Chairman Robert W. Goodlatte, R-Va., said in a statement.

But the negotiations weren’t without difficulty. The House approved a similar bill in February, but that version included language that many consumer groups found problematic.

The bill forbade people from unlocking multiple cellphones, a practice called bulk unlocking.

The Senate version, which the House agreed to Friday, removed the clause.

Currently, most contract phones are locked to the cellular provider that sells them, and consumers must obtain permission to unlock phones – even after the phones are paid off and contracts have expired.

The restored right would last only until the next scheduled review by the Copyright Office in 2016.