A sweeping immigration bill that would create a pathway to citizenship for 11 million undocumented immigrants was approved by a key Senate committee Tuesday.
The Judiciary Committee spent weeks debating the details of the plan, which was proposed by a bipartisan group of senators known as the Gang of Eight.
The bill survived weeks of hearings and more than 200 proposed amendments to get the final 'all clear' on Tuesday.
In addition to providing a pathway to citizenship, the bill would also invest billions in new border security measures and overhaul the legal immigration system.
A last minute addition that increased the number of visas available for foreign high-tech workers made it into the final bill.
According to CBS, the number of H-1B visas given to highly skilled workers would rise from 65,000 annually to 110,000, with the possibility of a further rise to 180,000, depending in part on unemployment levels.
The last minute addition convinced Utah Republican Orrin Hatch to support the compromise.
The 13-5 vote paved the way for a showdown on the Senate floor as early as the first week of June.
Supporters of immigration reform broke out into shouts and cheers when the committee announced its approval but the bill has a long way to go before becoming law.
More from GlobalPost: Obama talks immigration, collaboration from Mexico
An emotional debate over the right of gay Americans to sponsor green cards for their same sex spouses threatened to derail the Gang of Eight plan.
Influential Republicans such as Florida Sen. Marco Rubio said they wouldn't support the bill the amendment were included.
Senate Judiciary Committee Chairman Patrick Leahy (D-Vt.), who has been pushing various forms of the amendment for decades, told POLITICO that he would withdraw the amendment with a "heavy heart."
"I take the Republican sponsors of this important legislation at their word that they will abandon their own efforts if discrimination is removed from our immigration system,” he said.
More from GlobalPost: Gay rights amendment offered to immigration bill in Congress
The key provision of the bill, which survived hundreds of hours of negotiation, allows the undocumented immigrants already living in the US to obtain "registered provisional immigrant status" six months after the bill goes into effect.
Applicants must have arrived in the United States before Dec. 31, 2011 and maintained continuous physical presence.
They also must not have a felony conviction of more than two misdemeanors on their record and pay a $500 fine.