PHOENIX — A federal appeals court on Thursday slapped down the U.S. Forest Service for charging fees for those who want to park and hike in the Catalina Mountains.

Judge Robert Gettleman, writing for the court, said the justification used by the federal agency to impose the fees is not only directly contrary to the law but that its arguments are “illogical.” And the court rejected the agency’s contention that even if it cannot charge for parking, it can do so for hiking and camping.

The ruling, unless overturned, is a victory for several individuals who hike in the mountains who sued on behalf of other users. It overturns a ruling two years ago by a trial judge that the Forest Service was within its rights to charge $5 a day or $20 a year to those who park along the 28-mile Mount Lemmon Highway.

State Rep. Daniel Patterson, D-Tucson, one of the plaintiffs in the case, said he’s not against the Forest Service charging for the use of developed areas. And he said federal law does allow the agency to charge in certain limited situations, including where there are amenities.

But he called it “a stretch by bureaucrats” to extend that to parking and the use of undeveloped areas.

“There’s no tables, there’s no fire ring, you’re off on the side of a rough dirt road,” Patterson said. “I think it’s clear that Congress never intended for extra fees to be imposed on citizens for that undeveloped land.

Gettleman in the ruling, agreed.

“The Forest Service is prohibited from charging an amenity fee solely for parking,” he wrote. “There is nothing ambiguous about that text.”

Congress did allow for fees to be collected from those entering certain developed recreation areas. And government lawyers said the areas around the Mount Lemmon highway fit that definition.

Gettleman said it may be that a visitor, after parking, does something else for which the Forest Service is allowed to charge a fee. But that does not permit a fee to be imposed solely because of that mere possibility.

Beyond that, the judge said federal law “clearly contemplates that individuals can go to a place offering facilities and services without using the facilities and services and without paying a fee.”

For example, he said, the law precludes charging someone who walks, boats, rides or hikes through the forest without using the facilities and services.