SACRAMENTO — A first-in-the-nation bill aimed at expanding health care for illegal immigrants sailed through the Senate on Tuesday even as some lawmakers acknowledged that thousands of legal residents are having to struggle to access health care through the state’s Medi-Cal program.

In a 28-11 vote, a newly pared-down version of Senate Bill 4 by Sen. Ricardo Lara, D-Bell Gardens, would let undocumented Californians buy health insurance with their own money through the state’s Covered California exchange if the state is given a waiver by the federal government. It would also allow anyone age 18 and under to enroll in Medi-Cal regardless of immigration status — and let undocumented immigrants age 19 and up enroll in Medi-Cal if there’s money provided in the state budget.

“We are here today trying to address this critical issue that is vital to the success of our California: … providing care to our undocumented community,” Lara told colleagues before the vote. “The time has come for us to lead.”

Last week, SB 4 was scaled down from a “health care for all” bill that would have allowed all undocumented immigrants to enroll in Medi-Cal. But that bill would have cost taxpayers from $175 million to $740 million annually — something Gov. Jerry Brown said was just too expensive.

The exact cost of the amended SB 4 won’t be known until an upcoming fiscal analysis is released shortly, said Lara spokesman Jesse Melgar, though he said he believes the cost will be lower than $175 million.

The bill now heads to the Assembly Rules Committee, which is expected to send it to the Assembly health and appropriations committees. If it clears the Legislature, the measure goes to Brown, who could veto it.

During Tuesday’s hearing, Lara warned his colleagues not to “confuse” giving health care access to undocumented immigrants with the thorny issue of trying restore Medi-Cal rates for doctors.

Members of a budget conference committee are now seeking to restore 10 percent cuts to Medi-Cal reimbursements they imposed in 2011. Restoring the cuts, some lawmakers argue, would encourage more doctors to participate in the health program for the poor. But whether that will happen remains in doubt.

Lara argued that his colleagues should consider the current $1.4 billion annual cost of treating illegal immigrants, many of whom legally seek treatment in hospital emergency rooms.

“Your vote today,” Lara reminded fellow senators, “will be one you remember long beyond this year in this chamber” because it would help the two million undocumented workers “who toil in our fields, clean your hotel rooms, take care of your babies and provide much-needed support for your families.”

Two Republicans, Sen. Andy Vidak, R-Hanford, and Sen. Anthony Canella, R-Ceres, voted for the bill. Sen. Janet Nguyen, R-Garden Grove, was the only senator to abstain.

Like some of her Republican colleagues, Nguyen agreed that the bill had good intentions but could hurt Californians now enrolled in Medi-Cal.

“Unfortunately, they have limited access to their health care providers because we have failed to provide for their care,” Nguyen said.

“If you are going to do this, then (increase) funding (to) make sure you don’t promise someone a car — and then there is no engine in it. It’s wrong to enroll people into something they don’t have access to.”

The state Senate on Tuesday also approved bills that would raise the legal age to buy tobacco from 18 to 21 and establish a graduation incentive grant program for CSU students aimed at helping them obtain their degrees in four years.

Staff writer Jessica Calefati contributed to this report. Contact Tracy Seipel at tseipel@mercurynews.com or 408 920-5343 and follow her at Twitter.com/taseipel.