The earliest it could become effective is January, but the law still faces an impending hurdle.
Opponents of same-sex marriage have begun organizing to collect signatures for a referendum petition to place the law on the November ballot.
Opponents need 56,000 signatures by June 30 -- but have said they expect to collect almost twice that, the Associated Press reported.
Maryland's House of Delegates approved the legislation Feb. 17 on a 72-to-67 vote and sent it to the Senate, which approved it six days later on a 25-to-22 vote.
The law's passage came a year after another same-sex marriage bill died after proponents failed to secure the needed votes in the House of Delegates.