SAN BERNARDINO — A federal judge has ruled against environmentalists who sued the U.S. Forest Service claiming the agency was letting Nestle pipe water out of forest land on an expired permit.

U.S. District Judge Jesus Bernal said Tuesday that the permit by Nestle Waters North America “is still valid.” The judge noted that Nestle’s predecessor contacted the Forest Service to renew the permit before the old one expired in 1988, but the company never heard back from the agency.

The ruling was a setback to environmental groups, which sued the federal government last year to halt the piping of water in the San Bernardino National Forest unless a new permit is obtained.

The groups estimated Nestle siphoned 98,000 gallons of water a day from springs in the forest last year. The water is then trucked to a nearby plant, where it is bottled as Arrowhead Mountain Spring Water.

Last year, the Forest Service began an environmental review of Nestle’s spring water pipeline as part of the permit renewal process. The agency had said Nestle’s permit was in full force during the renewal period.

Nestle, which wasn’t a party in the case, said it is pleased with the latest decision.

Arrowhead has been sustainably bottling “water from the springs in Strawberry Canyon for more than 121 years — since before the creation of the San Bernardino National Forest,” the company said in a statement.

Environmentalists said the prolonged drought and water withdrawal in the San Bernardino National Forest are affecting wildlife.

“The court’s decision is disappointing, but the real tragedy lies in the fact that Strawberry Creek is drying up, dooming the plants, fish and animals that have relied on it for tens of thousands of years,” Ileene Anderson of the Center for Biological Diversity said in a statement.

A message asking for comment from the Forest Service was not immediately returned.