California is on the brink of becoming the first state in the nation to offer illegal immigrants the chance to buy insurance on an ObamaCare exchange -- testing what's being described as a "loophole" in the law.

The Affordable Care Act technically bars illegal immigrants from the insurance exchanges.

But the California bill, which last week passed the state legislature and was sent to Gov. Jerry Brown’s desk, would allow the state to apply for a federal waiver to open its exchange -- Covered California -- to undocumented residents.

There's no guarantee that will happen. Brown first would have to sign the bill and the Obama administration then would have to green-light the waiver. Even if that is granted, it wouldn't necessarily give illegal immigrants access to insurance subsidies.

Critics, though, say it’s a slippery slope and yet another example of how the federal government has hoodwinked Americans into getting behind the Affordable Care Act, or ObamaCare.

“This is the first step in another misrepresentation of the Affordable Care Act,” Ira Mehlman, a spokesman for the Federation for American Immigration Reform told US News & World Report. “It was sold to the American people on the fact that you wouldn’t have to subsidize health care for illegal immigrants.”

During his monthslong public pitch for the health care overhaul, President Obama had promised repeatedly the benefits that come with the federal and state health care exchanges would not be made available to illegal immigrants.

Currently, it is illegal under ObamaCare for undocumented immigrants to buy into the ACA.

According to HealthCare.gov, “undocumented immigrants aren’t eligible to buy Marketplace health coverage, or for premium tax credits and other savings on Marketplace plans.”

However, a provision in the law called the “innovation waiver” allows states like California to change portions of the law as long as the state makes coverage available to more people and as long as the federal government doesn’t get stuck footing the bill.

The bill’s sponsor, Sen. Ricardo Lara, a Democrat, says if Brown signs the bill, 390,000 illegal immigrants would be eligible to receive health insurance.

“We are talking about our friends. We are talking about our neighbors and our families who are denied basic health care in the richest state of this union,” Lara, the son of an undocumented worker, said during Senate negotiations last June.

While the California waiver would be the first of its kind on a large scale, 18 states already have offered subsidies for prenatal care for undocumented women and health insurance for all undocumented children, according to Think Progress.

Requests for comment to Brown's office and the U.S. Department of Health and Human Services, as well to Lara's office, were not immediately returned.