The U.S. Senate has passed a bill that would allow mobile phone customers to unlock their devices for the purposes of switching carriers.

The Senate, late Tuesday, approved the Unlocking Consumer Choice and Wireless Competition Act by unanimous consent.

The bill would overturn a January 2013 decision by the Library of Congress that removed legal protections for mobile phone unlocking. The library had previously allowed phone unlocking as an exception to the security circumvention provisions in the Digital Millennium Copyright Act (DMCA). The DMCA gives the Library of Congress rule-making authority over the anti-circumvention provisions in the law.

The House of Representatives passed its own version of a mobile phone unlocking bill in February. The House would have to pass the Senate bill before it goes to President Barack Obama for his signature.

The Senate bill reinstates a 2010 rule by the librarian of Congress that allows mobile phone owners to unlock their devices without running afoul of copyright laws. It also directs the librarian of Congress to consider whether other wireless devices, like tablets, should be eligible for unlocking.

The Senate Judiciary Committee approved the bill and sent it to the Senate floor just last week.

“I applaud the Senate for so quickly passing the bipartisan Unlocking Consumer Choice and Wireless Competition Act, which puts consumers first and promotes competition in the wireless phone marketplace,” Senator Patrick Leahy, a Vermont Democrat and bill sponsor, said in a statement. “I hope the House will soon take up and pass our bill so that consumers will be able to use their existing cell phones on the wireless carrier of their choice.”