RALEIGH, N.C. (AP) — A half-dozen state boards and commissions are unconstitutional because the governor lacks sufficient control over their membership, a judicial panel ruled Friday.

The unanimous order by the three trial court judges invalidates these regulatory, licensing and funding distribution boards until the General Assembly retools them with new legislation, or if a higher court blocks enforcement of the order if there's an appeal. Some of the panels regulate child care, hand out clean-water grants and license private investigators.

The ruling marks the latest outcome in a legal power struggle between Democratic Gov. Roy Cooper and the Republican-controlled legislature, although the issue dates back to another lawsuit involving the previous governor, Republican Pat McCrory.

The state Supreme Court's majority opinions in 2016 in the McCrory lawsuit and last January in another portion of Cooper's lawsuit helped describe how and when a board impinges upon the governor's authority to faithfully execute laws.

The three judges agreed with Cooper's private attorneys that each of the six panels failed to meet the constitutional standard developed in those rulings. The General Assembly selects a majority of members on each panel and the governor can neither easily remove members nor overturn the panel's actions. Each of the six commissions is housed in a Cabinet-level agency.

The challenged laws instituting the membership of these boards "violate separation of powers beyond any reasonable doubt," the judges wrote in their order.

Cooper challenged the Private Protective Services Board, Child Care Commission, Clean Water Management Trust Fund board, State Building Commission, Parks and Recreation Authority and Rural Infrastructure Authority.

Many of these commissions have been in place for decades, well before Republicans took control of the General Assembly in 2011. McCrory's lawsuit focused largely on a coal ash commission created by GOP lawmakers in which the General Assembly picked a majority of its members.

Pat Ryan, a Berger spokesman, declined comment on the case Friday because Berger's office had not fully examined ruling.

The attorney for Berger and House Speaker Tim Moore had argued in court that there was no categorical rule to determine a board's constitutionality, requiring case-by-case evaluations.

The court — comprised of Superior Court Judges Henry Hight, Jay Hockenbury and Nathaniel Poovey — rejected a request by Berger and Moore to put off the case until after the November elections. The legislature had submitted a proposed constitutional amendment that if approved would have made clear the legislature controlled the appointments of boards and commissions it creates.

That amendment, however, has been scaled back due to other litigation initiated by Cooper. That was not mentioned in Friday's ruling, but the judges wrote lawmakers had more than two years since the McCrory lawsuit ruling to alter state commissions.

Cooper spokesman Ford Porter said in an email "it should not take court action to get legislative Republicans to comply with the constitution but this seems to be the only way to get them to follow the law."