Minneapolis’ police union won its final legal battle Friday against the National Football League and the University of Minnesota over the right of off-duty officers to carry handguns at Vikings games at TCF Bank Stadium.

The union and the Minnesota Police and Peace Officers Association sued last year after the NFL banned guns for all but working officers and security personnel. In August, Hennepin County Judge Ivy Bernhardson determined that state law requires the NFL to allow officers to carry handguns. That law restricts the ability of private establishments to limit the carrying of firearms by off-duty police officers.

On Friday, the judge found that the Legislature had intended that the law apply to the university, the NFL and the Vikings. Her finding will remain in place as long as the team is contracted to hold professional football games at TCF Bank Stadium, which will end when it moves into its new downtown Minneapolis stadium in 2016.

The judge added that the university’s educational mission and constitutional authority to govern its own affairs are not impeded to such a degree that the law should be rendered unconstitutional.

“The university has received the Hennepin County District Court’s order in the case,” a U spokesman said Friday. “We are disappointed in the result and are still evaluating the decision and its reasoning. The university will decide on its next steps in the near future.”

Lt. John Delmonico, head of the police union, said he was happy with the decision, calling the ruling “very strong in our favor.”

State law allows off-duty licensed peace officers to carry weapons into private establishments even if the businesses or organizations ban guns. Last season, the NFL adopted a policy forbidding handguns for all but officers and private security working at games, setting off the challenge.

In her ruling, Bernhardson wrote that university regents elected to lease the stadium to a private commercial venture, which made the state law applicable. In the future, the U can avoid such a situation by not leasing the stadium to a private football team, she wrote.

“The university must elect a president from time to time. The university must construct new buildings,” the ruling said. “However, the university need not lease its stadium to a private commercial enterprise.”