WASHINGTON — A sweeping immigration bill that a bipartisan group of eight senators completed Tuesday seeks not only to fix chronic problems in the system and bring an estimated 11 million immigrants to the right side of the law. It would also reorient future immigration with the goal of bringing foreigners to the country based increasingly on the job skills and personal assets they can offer.

The bill, by four Democrats and four Republicans, is the most ambitious effort in at least 26 years to repair, update, and reshape the US immigration system.

The part of the bill expected to draw the most controversy is a 13-year pathway to citizenship for immigrants who have been living here illegally. In an effort to make that proposal acceptable to Republicans who fear it could unleash a new wave of illegal immigration, the senators placed a series of conditions along the pathway that would require the Department of Homeland Security to spend as much as $5.5 billion over 10 years to increase enforcement and extend fencing along the Southwest border.

The border security programs would have to be fully operational before any immigrants who had been here illegally would be able to apply for permanent resident cards, the first step toward becoming US citizens.

But the overall proposal is only one part of the complex bargain. Created by the senators in closed-door negotiations, the bill codifies other compromises designed to break logjams that have clogged the immigration system.

President Obama praised the legislation as ‘‘largely consistent’’ with the principles he had laid out for an immigration overhaul. After a meeting with two senators from the group, Charles Schumer and John McCain, the president said in a statement that the provisions of their bill are ‘‘all common-sense steps that the majority of Americans support.’’

McCain said his onetime rival for the presidency was ‘‘very supportive’’ but understands that ‘‘everybody didn’t get everything they wanted.’’

Kind words for president

Schumer praised Obama for giving the senators room to craft the bipartisan legislation. ‘‘I thanked him for that. John thanked him for that.’’

Schumer said the process would begin formally with hearings Friday in the Judiciary Committee, with the goal of voting on the bill in the Senate in late May or early June.

For the first time, the legislation would create a merit-based program to award the visa for legal permanent residents, known as a green card, based on a point system. When the merit system takes effect, five years after the bill is passed, at least 120,000 foreign-born people each year would be able to gain green cards by accumulating points based on their skills and education, as well as their family ties and the time they have lived in the United States.

Over a decade, the balance in the immigration system would gradually shift away from the 75 percent of visas that now go to family members of immigrants already here. As a result of the merit program, closer to 50 percent of visas annually would go to immigrants based on their family ties, while about half would be based on job skills.

As part of the border security triggers, the bill would require all employers, within five years, to verify the legal status of new hires using a federal photo-matching system. It would also require the federal government to create an electronic system within 10 years for checking foreigners as they leave the country through airports and seaports.

The bill also would also create two new guest-worker programs, one for farmworkers and another for low-wage laborers.

It would give employers in technology and science fields tens of thousands of new temporary and permanent resident visas annually, which they have been urgently seeking for computer engineers and foreign graduates with advanced degrees from US universities. It raises current annual caps on temporary high-skilled visas, known as H-1B, to 110,000 from 65,000, while adding 5,000 more of those visas for the foreign graduates. The cap would gradually rise to 180,000.

And the bill would allow young immigrants who came to the United States illegally as children to become citizens after only five years.

Perhaps the most original compromise is the path to citizenship for immigrants here illegally. Several Republicans, especially Senator Marco Rubio of Florida, insisted that there could be no special, separate path for them. But Democrats, led by Schumer, fought for a direct, manageable pathway that would ensure that most immigrants here illegally get a chance to earn their way to becoming citizens.

In a first phase, those immigrants would spend a minimum of 10 years in Registered Provisional Immigrant Status, which would allow them to work and travel. After 10 years, they would be eligible to apply for green cards through the merit system.