WASHINGTON - A sweeping overhaul of the U.S. immigration system took a major step toward viability Tuesday when a Senate panel gave bipartisan approval to a landmark bill offering a path to citizenship for millions.

The Senate Judiciary Committee approved the contentious and potentially historic legislation by a 13-5 vote, following weeks of marathon hearings and meetings to consider more than 200 amendments.

The bill emerged with its core mostly intact, including requirements for major advances in border security, visa programs for high- and low-skilled workers, and expansion of a comprehensive e-verify system for employers.

It needs 60 votes to pass the 100-seat Senate and would then head to the Republican-controlled House of Representatives, where its fate is uncertain and where lawmakers are drawing up their own immigration legislation.

"We've got a ways to go but we will get there," exuberant Senate Democrat Chuck Schumer, one of four Democrats and four Republicans to craft the huge bill, said after the bipartisan vote.

Bill Includes 13-Year Path to Citizenship

The legislation, which would legalize more than 11 million undocumented people currently in the shadows and set most of them on a 13-year path to citizenship, is now set for a debate showdown on the Senate floor in June.

President Barack Obama cheered the vote and urged lawmakers to put partisanship aside in order to help it clear the Senate.

"None of the committee members got everything they wanted, and neither did I, but in the end we all owe it to the American people to get the best possible result over the finish line," the president said in a statement after what was a rare victory for him in recent weeks.

An elated committee chairman Senator Patrick Leahy, who shepherded the complicated bill through a marathon markup session, said he hoped "that our history, our values and our decency can inspire us finally to take action."