LITTLE ROCK, Ark. -- The attorney general of Arkansas said Saturday he supports allowing same-sex couples to wed, but will continue defending his southern state's 2004 ban on gay marriage in court because he believes it is his duty to do so.

Arkansas voters overwhelmingly approved a constitutional amendment defining marriage as between a man and a woman, but that ban and others across the U.S. are facing legal challenges. Attorneys general in several states have grappled with how to respond.

Attorney General Dustin McDaniel 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.

The top attorneys in at least five states have declined to defend same-sex marriage bans against lawsuits filed by gay couples. Opponents of gay marriage have accused those attorneys general of shirking their responsibilities to uphold the laws of their states.

McDaniel said he didn't believe attorneys general should allow their personal views to influence whether they defend a state law.

"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 told the AP after his speech.

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 Arkansas' ban.

McDaniel announced his support for gay marriage after criticizing U.S. Attorney General Eric Holder for telling his state counterparts in February they weren't obligated to defend laws in their states banning same-sex marriage if the laws discriminate in a way forbidden by the Constitution.

McDaniel, a Democrat, had voiced support for civil unions when he ran for the elected position of attorney general in 2006, but said then he believed marriage was between a man and a woman. He said during a question and answer session with editors that there wasn't any single incident that changed his mind about gay marriage.

"It's become more and more difficult for me to accept the idea of anyone being treated as a second class citizen," McDaniel said.

McDaniel said after his speech that he had considered backing marriage equality when he briefly ran for Arkansas governor last year. He dropped out of the race after admitting to an inappropriate relationship with an attorney.

The head of the group that campaigned for the ban in 2004 said he was surprised by McDaniel's comments but still had faith in McDaniel's office to defend the amendment.

"I'm disappointed because he didn't have to take a position one way or the other. It is disappointing that he has taken this position," said Jerry Cox, president of the Arkansas Family Council. "However, I do not doubt the ability of his staff to adequately defend the Arkansas marriage amendment because I believe the people on his staff are very capable lawyers and I have seen them work very capably on other issues."

The head of the Human Rights Campaign, the largest U.S. lesbian, gay, bisexual and transgender civil rights organization, praised McDaniel for his comments.

"Today Attorney General McDaniel adds his voice to an ever-growing chorus of Americans from across the country that are standing up for the right of all couples to marry -- and there is no turning back that tide," HRC President Chad Griffin said in a statement released by the group.