Maryland Governor Martin O'Malley has said he thinks voters will uphold a gay marriage law.

O'Malley, who championed marriage equality in his annual State of the State address and at committee hearings debating the bill, said at a signing ceremony held in Annapolis that he supports gay nuptials because the state has an obligation to protect all children, including those of gay couples.

Opponents of the law have vowed to repeal it through a voter referendum.

Appearing last night on MSNBC's The Rachel Maddow Show, O'Malley conceded that the challenge to the law was real, but added that he believes voters will side with “human dignity,” a phrase he's used often during the debate.

(Related: Martin O'Malley on gay marriage: Even 4-year-old values human dignity.)

“There has been a conversation that has been taking place among our elected representatives over the last year, and the fruit of that conversation was that together we concluded that in fact we could pass a law that protects religious freedom and the rights of individuals equally, and to do that at the same time. In the end, we concluded that human dignity – the dignity of every person, the dignity of every child’s home – as the principle where we could come together. And I think that's what people are going to do now as they talk around their own kitchen tables, in their family living rooms, and at work. So if there's a referendum, I believe that the people of our state will once again side on the side of human dignity.” (Watch the entire exchange at MSNBC.)

A poll released earlier this week found that a narrow majority (52%) of Maryland voters would “definitely” or “probably” vote to uphold the law.