Tucked into a corner of West Fairmount Park, historic Chamounix Mansion has operated as a youth hostel since 1965, offering Boy Scouts, church groups, and European backpackers an affordable way to visit Philadelphia.

The hostel is run by a nonprofit that also maintains the 1802 mansion, which is owned by the city and was falling into disrepair before the hostel opened. The city has always treated Chamounix as a unique institution, giving it a permit to operate as Philadelphia’s only “youth hostel" — which isn’t defined in city law — and not requiring it to register as a rooming house, like other hostels, or pay the hotel tax.

Until now. The city is attempting to retroactively collect $480,000 in unpaid hotel taxes, fees, and interest from 2008 to 2013, saying the mansion meets the legal definition of a hotel.

Having to pay that tab would likely cause the hostel to shut down, said Bill O’Brien, who chairs the board of the nonprofit. The nonprofit is fighting the city in concurrent cases in the Court of Common Pleas and the Board of Review of Taxes.

“You can’t have your cake and eat it, too. The city has had this benefit for the last 50 years where we’ve cared for these buildings, renovated them, and now they want to take the funds we have left for that purpose," O’Brien said. "If they’re hypothetically successful, we couldn’t continue to run the operation.”

It’s not clear what prompted the city to suddenly aim its spotlight on the mansion, at a time when the city’s finances are stable and it has been attempting to burnish its credentials as a tourist spot and millennial magnet.

A spokesperson for Mayor Jim Kenney declined to comment, citing the pending litigation. In a court filing, the city has noted that the hotel tax law says nonprofits and hostels are subject to the levy, which is 8.5% of the cost of a stay.

O’Brien pointed to differences between Chamounix’s operations and those of a hotel: Visitors, who pay $25 per night, must leave the building every day between 11 a.m. and 4:30 p.m.; they cannot stay longer than seven days and must be from at least 50 miles away; alcohol and tobacco are banned; and guests sleep in bunk beds in a shared dormitory.

The mission of a youth hostel, he said, is also different than that of a hotel.

“The purpose of a youth hostel is to encourage young people to come and learn about Philadelphia, and for Philadelphians to learn about people from other cultures, and to do that in a safe, clean, inexpensive venue,” he said.

Former mayors said they disagreed with the city’s application of the tax, including Ed Rendell, who called it “manifestly unfair."

“We didn’t enforce the tax because we viewed it more like a YMCA” than a hotel, Rendell said.

The city has the right to apply the tax going forward, Rendell said, but it shouldn’t charge the hostel for previous years. “It’s not like they were deadbeats and didn’t pay it,” he said.

O’Brien said the nonprofit’s board has considered agreeing to pay the tax going forward if the city drops its claim for the back taxes, but so far hasn’t committed to an agreement with the city.

Michael Nutter, who was mayor during the period for which the city is now trying to collect the unpaid taxes, said he never considered Chamounix a hotel.

“In my mind at least there’s just no legitimate argument that it functions like a hotel or would be subject to the hotel tax,” he said.

It isn’t the first time the city has attempted to change its interpretation of a tax’s applicability and levy it retroactively.

During Nutter’s administration, the city sought a combined $1.6 million in unpaid taxes from three strip clubs in what came to be known as the “lap dance tax" case. The city argued that the amusement tax, which is 5% of the cost of admission at entertainment events, should apply to private dances inside the clubs, but a state judge stopped the city from collecting it for those encounters.

“These two issues are very, very different from each other,” Nutter said. “I don’t see the same ability to make as compelling an argument about Chamounix Mansion. It’s a singular entity. It’s not like there are 20 of them all over the place.”

A summer home for the Plumsted family, which produced two of Philadelphia’s first mayors, the mansion was originally built to face the Schuylkill, the only way to access the building before there were roads in what is now Fairmount Park.

After Chamounix Drive was laid, a portico was added to reorient the building toward the road, which became a popular racetrack, first for horses and later for cars. From the late 1800s to the 1920s, the mansion served as a sort of grandstand and bar for spectators.

In the ensuing decades, Chamounix and other Fairmount Park mansions were left vacant and fell into disrepair, so the city allowed municipal employees to live in the homes to maintain them and keep out squatters. But the arrangement led to a corruption scandal when the public learned city workers were living rent-free in taxpayer-owned mansions.

After the families moved out in the early 1960s, the mansions fell prey to vandalism and fires. Chamounix was slated to be demolished when a group of young, civic-minded Philadelphians approached the city with an idea for a youth hostel.

The nonprofit Friends of Chamounix Mansion has operated the mansion on a $1-per-year lease with the city. Visitors pay $25 per night, which covers the day-to-day operations of the hostel, O’Brien said. The board raises money for renovations and improvements to the mansion and the 1850 carriage house next door, and has invested $1 million in the buildings in the last 20 years, he said.

“The mansion people provide a real service to the city,” Rendell said. “Not only do they attract young people — and we want young people to come to the city — but the mansion people, at their own expense, with the money they raise, keep the mansion up.”