Arkansas attorney general Dustin McDaniel said on Saturday he supports allowing same-sex couples to wed, but will continue defending his state's 2004 ban on gay marriage in court.

McDaniel, a Democrat serving his final year in the elected position of the state's top attorney, became the first statewide official in Arkansas to back same-sex marriage.

"I want to tell you I do support marriage equality and I do believe Arkansans should have the right to be equal in the eyes of the law," McDaniel said, speaking at the Associated Press Managing Editors convention.

Voters overwhelmingly approved a 2004 state constitutional amendment defining marriage as between a man and a woman, but that ban and others across the US are facing legal challenges. Other state attorneys general have also grappled with how to respond.

Seventeen states allow gay marriage, and federal judges have struck down bans in Michigan, Utah, Texas, Oklahoma and Virginia. An Arkansas judge is expected to rule by Friday in a lawsuit challenging the Arkansas ban.

"I'm going to zealously defend our constitution, but at the same time I think it's important to let people where I stand on the matter," McDaniel said after his speech.

McDaniel had voiced support for civil unions when he ran for attorney general in 2006, but said then he believed marriage was between a man and a woman. McDaniel ran briefly for governor but dropped out early last year.

McDaniel said he was not calling on any other statewide officials or candidates to support gay marriage, and said he would not campaign for ending the ban while serving as attorney general.