PORTLAND, Maine — Maine’s highest court has ruled that the city of Lewiston is immune from a lawsuit in connection with a plane crash in 2006 that killed three Lewiston High School students.

A superior court judge last year ruled that the city was not immune in the wrongful-death lawsuit filed by the victims’ families. The students were killed when the plane they were on crashed in western Maine while they were participating in the high school’s Air Force Junior ROTC program.

In Thursday’s 4-3 decision, the Maine Supreme Judicial Court agreed with Lewiston’s claim that the Maine Tort Claims Act makes it immune from the lawsuit.

In a dissenting opinion, three justices said governmental immunity shouldn’t apply to Lewiston because it was using the aircraft at the time of the accident.