SEATTLE (AP) — The duties of Washington Attorney General Bob Ferguson are laid out in state law. Among them: to defend any state officer or employee in court if they're sued in their public capacity.

So how is it that the popular Democrat has not only declined to represent the Legislature in a public records lawsuit brought by news organizations, but has actually filed a friend-of-the-court brief contrary to lawmakers' position in the case?

His actions have lawmakers objecting, saying it's a conflict of interest for Ferguson to oppose them. The attorney general insists no such conflict exists concerning the attorneys he has working on the case and that his office also has a duty to ensure compliance with the Public Records Act.

"The most striking factual point in this is that it isn't a situation where it was compulsory for Mr. Ferguson to appear in this controversy," said Phil Talmadge, a former Democratic state senator and state Supreme Court justice. "His involvement was unnecessary. It really was a provocative act, vis-a-vis his representation of the Legislature."

The unusual situation has arisen in a lawsuit filed by The Associated Press and other news organizations against the Legislature, seeking a ruling that individual lawmakers are covered by the state's Public Records Act and must respond to document requests just as other public offices do. A hearing in the case and a potential ruling are set for Friday in Thurston County Superior Court.

Ferguson says he would have represented the lawmakers if asked, but the Legislature notified Ferguson in September that it would hire outside counsel. After Judge Chris Lanese invited the Attorney General's Office to file a friend-of-the-court brief — a request which the attorney general was free to decline, the judge noted — the Legislature amended its notice to Ferguson, asking him to appoint deputy solicitor general Jeff Even as co-counsel.

Ferguson this month refused. His office filed a friend-of-the-court brief that contradicted the Legislature's argument that the records law doesn't apply to individual lawmakers. In a letter to one of the Legislature's private lawyers, Paul Lawrence, Ferguson said he wouldn't appoint Even to work for a client who was accusing the office of violating conflict-of-interest rules.

The state Supreme Court has held the attorney general typically has the authority to file amicus briefs on matters of public concern. In another case, it held that then-Attorney General Rob McKenna must represent the Department of Natural Resources in an appeal, even though McKenna disagreed with the department's legal arguments.

Ferguson drew a distinction between the records case and that one: Unlike other agencies, the Legislature is allowed to hire its own counsel. In McKenna's case, the department would have been unrepresented if the attorney general refused to participate.

In an email to the Legislature's legal team, one of Ferguson's top advisers, Solicitor General Noah Purcell, dismissed concerns about any conflict of interest. He noted that unlike private law firms, public firms — such as the Attorney General's Office or prosecuting attorneys — must sometimes represent clients whose interests don't align. In such cases, they set up "screens," ensuring that employees involved in one client's case don't work on or become privy to confidential information about the other client's.

And, he and Ferguson said, that's what the office did: While Even had conversations with the Legislature and with its outside counsel about the case early on, he wasn't involved in the drafting of the friend-of-the-court brief.

"Because the Attorney General's legal duties may at times require representing competing public interests, the Supreme Court has said that, if 'actual conflicts of interest' do arise, different assistant attorneys general in the office 'can, and should, be assigned to handle those inconsistent functions,'" the Attorney General's office wrote in a court filing Thursday.

Purcell also said the office had given serious thought to and consulted with outside ethics experts about the potential conflict of interest, and that it was satisfied that its actions were appropriate. The attorney general's office could not recall rejecting a judge's request for briefing before, and saw no reason to do so here, he said.

That wasn't good enough for the Legislature's lawyers.

Lawrence said nothing authorizes the attorney general to impose a screen to voluntarily participate in a case where the office is otherwise involved, though he said the issue had never been litigated.

"The plaintiffs don't have a right to have the attorney general represent them. The Legislature does have that right," Lawrence said.

Talmadge suggested Ferguson, whose many lawsuits against the Trump administration have garnered national attention, became involved for the publicity, calling him "one of the most publicity-seeking public officials in the state."

Ferguson rejected such criticism.

"My reasons for filing an amicus brief are straightforward — the court asked," he said in an emailed statement. "Phil Talmadge may be willing to ignore a court's request in his legal practice. I am not."