Earlier in the 90-day session, the divisive issue touched off a broader debate on immigration rights and exposed the problem of fraud associated with the flow of illegal immigrants from other states who come to Maryland seeking government-backed credentials. Maryland is one of four states - and the only one east of the Rockies - to issue driver's licenses without requiring proof of an applicant's legal status in the United States.
The Senate originally wanted all new and renewing driver's license applicants to show proof of lawful presence, while the House wanted a more generous plan that would permanently grandfather in illegal immigrants who already have a Maryland license.
A series of frantic meetings Saturday, followed by intense vote-finagling on the House floor, resulted in a compromise that allows people who already hold licenses to renew them without showing proof they are in the United States legally. Those licenses would be marked "not federally compliant" and would expire July 1, 2015, at the latest.
All new license applicants would need documentation of lawful presence by June 1. Sen. Andy Harris, a Baltimore County Republican, said the compromise was nothing more than amnesty for illegal immigrants and promised, "you ain't seen lines like you'll see in the next two months" at the Motor Vehicle Administration.
O'Malley said he wanted Real ID legislation on his desk and said he would sign any version of it, including the compromise plan.
Licensing was one of several contentious policy questions the legislature dealt with this year. Last month, senators rejected O'Malley's bid to repeal the death penalty, and lawmakers instead passed a series of evidentiary restrictions that will make the state's capital punishment statute one of the most limited in the country.
And on Monday, dealing with a late-emerging concern, the General Assembly gave O'Malley the authority to purchase the Preakness and other Maryland horse racing assets of its bankrupt owner, by eminent domain, if necessary.
The 93-43 vote in the House on the session's final day followed Senate approval on Saturday. The emergency measure will go to the governor's desk less than a week after he introduced it.
Lawmakers passed O'Malley's bill over the impassioned warnings of Republicans, who said wielding the state's power of condemnation in pursuit of a horse race was a dangerous threat to private-property rights.