Watch Senator John McCain defend the immigration bill on the Senate floor.

Thursday, the U.S. Senate passed a comprehensive immigration reform bill that heightens border security and provides a way for an estimated 11 million people to legalize their status.

The bill moved swiftly in the Senate, where a bipartisan group of senators - the "Gang of Eight" - sponsored it and has pushed it for the last two months.

The legislation would overhaul the nation's beleaguered immigration system, beefing up border security, providing a lengthy and expensive process for people to legalize their status and change work visas for both high-skilled and low-skilled labor.

After a 68-32 vote Thursday afternoon, the Senate made a final decision. The bill is moving forward to the House.

Senator Jeff Flake released a statement content with the final decision.

“Arizonans have had to wait far too long for Congress to take action to fix our broken immigration system. I am pleased to join my colleagues on both sides of the aisle in supporting the passage of comprehensive reform legislation,” said Flake. “While neither side got everything it wanted, this legislation goes a long way toward securing our borders, modernizes our legal immigration system, spurs economic growth and provides a tough-but-fair solution to those here illegally. Now, it’s time for the House to act.”

Watch Senator Flake's speech.

The bill's future in the House is uncertain. Republicans in control of that chamber have said they oppose any form of "amnesty," and many of them call the Senate bill's path to citizenship "amnesty." They say they want the border secure first before any other immigration considerations are undertaken.

The legislation is being watched closely in Arizona, which has been the main entry point for people coming illegally from the south for decades. Gov. Jan Brewer has led the fight against what she has called the federal government's shirking of its responsibility to secure the border.

Brewer has said she is encouraged by the Senate legislation but wants to see border security measures even tougher than they are now.

Under the bill as it now stands, the Border Patrol force would be increased, more fencing would be built and technology, including drones, would be used to monitor the border. If 90 percent of people attempting to cross the border illegally are accounted for, then under the bill, the border will be considered secure.

That level of security will be key to triggering the start of the path to legalization for immigrants now in the country illegally.