PORTSMOUTH, Va. (WAVY) — The multiyear legal battle over the Portsmouth City Jail is over — for now.

City Council voted unanimously Tuesday night to drop its case that asks a judge to order Sheriff Michael Moore to move his inmates to the Hampton Roads Regional Jail.

The city and sheriff were currently awaiting a final ruling from a judge after nearly two years of back-and-forth.

“I believe this whole legal situation is totally unnecessary. It has dragged the city through a process that it never should have gone through,” said Councilman Mark Whitaker, who made the motion. “I think that our sheriff … has served the city well and deserves the respect to us being able to sit down and to discuss and negotiate and move forward in a light that will reflect what is best for our city.”

The fight over the aging waterfront jail has gone on for years but escalated in July 2019. That’s when the city condemned the jail, which is operated by the sheriff, with little notice. The city building and code official condemned the jail and the rest of the civic center after they said they found problems with the fire suppression system and unsanitary conditions.

The sheriff sued to keep it open. However the city — saying it doesn’t have the financial resources to fix the jail or build a new one — continued to demand inmates go to the HRRJ, which the city has paid nearly $6 million a year to have available. As of early summer 2020, only 20 of the 250 beds paid for by taxpayer dollars for were in use.

“We all need to work together to find the best solution, the best solution to moving our jail off the waterfront,” said Mayor Shannon Glover.

Moore was not immediately available for comment.

Moore has said he agrees with city plans, however, to eventually move the jail away from the waterfront and demolish the jail complex, which was built in 1969.