D.C. Mayor Vincent C. Gray signed a measure into law Monday that will allow illegal immigrants to apply for driver’s licenses next year, calling the privilege a “civil rights issue” for those in the country illegally but who still need to get to jobs, classes and houses of worship.

The District’s new law, which will take effect in May, will align the nation’s capital with a handful of mostly Democratic-leaning states, including Maryland, where illegal immigrants can begin applying for licenses in January.

After flirting with the idea of giving illegal immigrants the same licenses as citizens, and therefore violating federal homeland security rules, the D.C. Council this month voted to follow the path of Maryland and, recently, California.

Those who cannot prove citizenship will have their IDs stamped as “not valid for official federal purposes.”

The IDs will not be valid for use as identification to board commercial aircraft. They also cannot be used to enter federal buildings or nuclear facilities — the limitations set out by the 2005 REAL ID Act.

The U.S. Department of Homeland Security has not yet begun enforcing the eight-year-old law, but says it will lay out a plan in coming weeks to begin doing so next year.

Gray called the IDs a “limited purpose” driver’s license that would make the roads safer by ensuring anyone who wishes to drive can become licensed and insured to do so legally.