HARTFORD, Conn. (AP) — The Department of Justice has given the green light to National Guard members on active state duty across the country to join labor unions.

The agreement comes despite a 1978 U.S. law that makes it a felony for military personnel on active federal duty to unionize. The Justice Department approval came in a lawsuit settlement finalized Tuesday in federal court in Connecticut.

Labor unions sued the department and Attorney General Merrick Garland seeking collective bargaining rights for Connecticut National Guard members.

The Justice Department says the federal ban doesn’t apply to Guard members on state duty.