A vaguely worded provision tucked into the $39.1 billion budget and passed at the 11th hour this week is setting off alarms over the possibility the state will issue driver’s licenses to illegal immigrants.

The issue centers on the state’s mandate to meet standards under federal law passed in 2005, which ramps up the qualifications for residents to get a state driver’s license and is intended to prevent terrorists from using the IDs to enter federal buildings or board planes. The state has been working under a waiver from issuing so-called Real ID licenses, but that expires in October.

The debate sprang into budget discussions this week when language, introduced by state Sen. Thomas McGee, was included, requiring people to have a “lawful presence” in the U.S. to get either a federally compliant Real ID license or a standard-issue Massachusetts driver’s license.

The “lawful presence” standard, set under federal law, covers U.S. citizens, but also immigrants who fall under a range of categories, including those who have been admitted for temporary residence in the U.S., granted asylum, or those with pending or approved temporary protected status.

But it immediately sparked vastly different views from advocates on both sides of the issue.

Jessica Vaughan of the Center for Immigration Studies — a Washington, D.C.-based think tank that backs stricter immigration laws — said the law gives discretion to the registrar of the Registry of Motor Vehicles in issuing a Massachusetts license.

“It’s clearly set up to provide a pathway to a license for illegal immigrants,” Vaughan said.

But Amy Grunder, policy director for the Massachusetts Immigrant & Refugee Advocacy Coalition, said that’s a power the registrar already has.

“My read is that current eligibility for regular licenses is unchanged, except with regard to temporary licenses and IDs,” she said in an email, adding it mainly affects those temporarily in the country on non-immigrant visas.

The Baker administration is still in the midst of reviewing it. “It has been and continues to be the policy of the Baker-Polito administration not to issue licenses to undocumented individuals,” spokeswoman Lizzy Guyton said.

McGee, who also chairs the state Democratic Party, sought to tamp down concerns on the Senate floor. “No one who is not here legally would be eligible,” he said, according to a transcript from the State House News Service. “We’ve been approved by the federal government. They are accepting this.”