Texas Attorney General Ken Paxton issued a legal opinion Monday supporting a Montgomery County courtroom chaplaincy program — and the use of prayer to open legal proceedings.

Wayne Mack, a justice of the peace and coroner, would likely prevail in any legal challenge to the volunteer-led chaplaincy program he organized in the southeast Texas county, the opinion states.

The program does not appear to violate religious freedom guaranteed by the U.S. Constitution, the Republican attorney general wrote in an opinion that does not have the force of law, but reflects Paxton's legal reasoning.

Lt. Gov. Dan Patrick, a Republican who frequently touts his Christian beliefs, requested the legal opinion after Mack’s program sparked controversy.

In late 2015, the state Commission on Judicial Conduct investigated a complaint filed against Mack related to the program. Aside from offering courtroom prayer, the chaplaincy effort — open to religious leaders of any faith — offered counseling to folks that Mack, in his coroner role, dealt with at death scenes.

The commission ultimately dismissed the complaint but issued a letter that “strongly cautioned” against continuing the program and courtroom prayer services — to Patrick’s chagrin.

Neither that program nor the courtroom prayer specifically appears to violate the clause of the First Amendment that states: "Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof," Paxton’s opinion states.

Also passing constitutional muster, according to Paxton’s opinion: Use of the phrase "God save the State of Texas and this Honorable Court” to open legal proceedings.

On Monday, Mack called the opinion “a clear victory for religious liberty.”

“I’m thankful for Lieutenant Governor Patrick’s request for an opinion on this important issue and that Attorney General Paxton made clear that the Constitution permits judges to invite volunteer chaplains to open sessions of court with prayer,” he said in a statement circulated by the First Liberty Institute, a Plano-based legal group that represented Mack before the Commission on Judicial Conduct.

Within state government, chaplains aren’t rare. Texas Agriculture Commissioner Sid Miller appointed an official volunteer chaplain — a Christian friend from his hometown of Stephenville — to counsel interested employees at his agency.

Read More With Chaplain, Texas Agriculture Chief Brings Faith to Work

And a few other Texas agencies employ non-denominational chaplains, but they tend to focus more on folks like prison inmates or hospital patients.