WASHINGTON — Attorney General Eric H. Holder Jr. on Monday injected the Obama administration into the emotional and politicized debate over the future of state same-sex marriage bans, declaring in an interview that state attorneys general are not obligated to defend laws that they believe are discriminatory.

Mr. Holder was careful not to encourage his state counterparts to disavow their own laws, but said that officials who have carefully studied bans on gay marriage could refuse to defend them.

Six state attorneys general — all Democrats — have refused to defend bans on same-sex marriage, prompting criticism from Republicans who say they have a duty to stand behind their state laws, even if they do not agree with them.

It is highly unusual for the United States attorney general to advise his state counterparts on how and when to refuse to defend state laws. But Mr. Holder said when laws touch on core constitutional issues like equal protection, an attorney general should apply the highest level of scrutiny before reaching a decision on whether to defend it. He said the decision should never be political or based on policy objections.