A new law that will expand the ability of illegal immigrants to obtain driver’s licenses in Maryland is set to take effect on Wednesday.

Under the measure, which Gov. Martin O’Malley (D) signed into law in May, the state is making permanent a two-tiered system for obtaining driver’s licenses that it adopted on a temporary basis in 2009 to comply with a federal law.

Going forward, illegal immigrants will be able to obtain a second-tier driver’s license if they meet certain requirements, including having filed tax returns for the past two years. The licenses will not be recognized by federal agencies, however, and therefore not valid for boarding an airplane or entering a federal building.

The two-tiered system adopted in 2009 was set to expire in 2015 and restricted eligibility to those who already had licenses at the time.

During legislative debate, proponents said that the new measure would make the state’s roads safer by allowing the Maryland Motor Vehicles Administration to administer written and road tests for undocumented citizens, and by making it possible for insurance companies to issue them liability coverage.

Opponents argued that the bill — known as the Maryland Highway Safety Act of 2013 — would reward the behavior of those who have entered the country illegally.

The legislation, sponsored by Sen. Victor R. Ramirez (D-Prince George’s) passed 29 to 18 in the Senate and 82 to 55 in the House of Delegates.

The law is one of only a handful set to take effect on Jan. 1 in Maryland. Most other measures passed during the 2013 session of the General Assembly took effect on July 1 or Oct. 1.