(This version of the Nov. 10 story, corrects the name to Natural Resources Defense Council in paragraph 3)

The Flint Water Plant tower is seen in Flint, Michigan, U.S. on February 7, 2016. REUTERS/Rebecca Cook/File Photo

(Reuters) - A federal judge on Thursday ordered state and city officials to deliver bottled water directly to qualified residents in Flint, Michigan, where a water contamination crisis has made unfiltered tap water unsafe to drink since April 2014.

Officials must deliver four cases of bottled water a week immediately unless they can prove a water filter is installed and properly maintained at a home or if residents opt out of a filter or deliveries, U.S. District Judge David Lawson said.

The ruling came in a lawsuit filed by residents and advocacy groups Concerned Pastors for Social Action, the Natural Resources Defense Council and the American Civil Liberties Union of Michigan.

“Here the plaintiffs seek a stop-gap measure that provides ready access to safe drinking water,” Lawson said. “It is in the best interest of everyone to move people out of harms way before addressing the source of the harm.”

Flint, a predominantly black city of 100,000, was under the control of a state-appointed emergency manager when it switched its water source in April 2014 to the Flint River from Lake Huron in a money-saving move. The more corrosive river water caused lead to leach from city pipes and into the drinking water.

The city switched back in October 2015 after tests found high levels of lead in blood samples taken from children, but the water has not returned fully to normal. Flint has been replacing lead pipes running to homes, and state officials have said the water is safe to drink if properly filtered.

The crisis drew international attention and numerous lawsuits and led to calls by some critics for Michigan Governor Rick Snyder to resign over the state’s response.

The groups’ lawsuit, filed in January, seeks replacement of lead service pipes. They later asked Lawson to order home water deliveries or faucet filter installations because transportation issues made it hard for some residents to get to water distribution centers.

The city and state argued that bottled water was widely available at government-run distribution points and ordering door-to-door deliveries could be financially crippling.

Lawson called the city and state efforts commendable, but said the plaintiffs offered credible anecdotal evidence the distribution network was in flux and not completely effective.

“The court correctly recognized that the government created this crisis, and it’s the government’s responsibility to ensure that all people in Flint have access to safe drinking water,” NRDC attorney Dimple Chaudhary said.