ANNAPOLIS, Md. (AP) — State agencies in Maryland should recognize same-sex marriages performed in other states until the legislature or courts decide otherwise, Maryland’s attorney general said Wednesday in a long-awaited legal opinion.

The opinion by Attorney General Douglas F. Gansler concluded that the state’s highest court was likely to rule that legal same-sex marriages in other states are valid in Maryland. But, he said, the matter “is not free from all doubt.”

Maryland law defines marriage as being between a man and woman, and the state is one of six that do not specifically address the validity of same-sex marriages from other states.

While the opinion does not change the law, it can guide state officials. The attorney general’s office would defend a state agency in court for recognizing a same-sex marriage from another state.