O'Malley signed the bill on Tuesday in Annapolis, where the Democratic governor posed for five sets of photographs to accommodate supporters during a signing ceremony.
O'Malley says the bill will enable the state to have a more highly educated workforce.
The measure allows illegal immigrants to pay in-state tuition rates at public colleges if they complete two years at a community college. Students also will have to show that their parents paid state income taxes. Male students also will be required to sign up for Selective Service to be eligible for the draft.
Republican opponents are leading a petition drive in hopes of overturning the legislation in a 2012 referendum.
Copyright 2011 by The Associated Press. All Rights Reserved.
WAMU's Matt Bush will have more on this story, including reactions from both sides of the debate.