The Nutter administration and the Boy Scouts of America Cradle of Liberty Council have reached a settlement that will end a five-year court battle sparked by the scouts' national policy banning openly gay members.

Because of that policy, the city sought to evict the scouts from their longtime home in a building on city property near Logan Square.

A federal jury said in 2010 that doing so would violate the group's First Amendment rights. The city's appeal before the U.S. Court of Appeals for the Third Circuit was pending.

Under the settlement, announced Friday, the city will pay the Cradle of Liberty Council $825,000. In exchange, it agreed to move out, with administrative staff leaving by June 30 and the retail store closing by Oct. 31.

"When a significant case can be resolved with both parties feeling satisfied with the results . . . I think that's a good thing," said City Solicitor Shelley Smith.

Tom Harrington, Cradle of Liberty scout executive, said the administrative staff would work temporarily out of an office in Wayne but the council intends to seek new space in the city.

"We just felt it was time to put an end to further litigation and return to serving the kids of the city," he said. "In the end, scouting doesn't happen in an office. Scouting happens in neighborhoods, scouting happens in church basements."

The reaction in the gay and civil rights communities was bound to be divided between those who wanted to continue the fight and those who wanted to move on, said Mark Segal, publisher of Philadelphia Gay News.

"I, for one, am glad to see some closure coming," he said.

Duane Perry, an Eagle Scout and member of a mayoral advisory panel on lesbian, gay, bisexual and transgender issues, said he thought the case was winnable on appeal.

He said that the LGBT panel "strongly urged" the mayor to fight the 2010 verdict, and that paying the scouts to leave "supports discrimination."

"The city solicitor snubbed everyone and said . . . 'I'm going to settle,' " he said. "And the bottom line is, discrimination is still going on."

The settlement announcement comes in the midst of the Equality Forum, a global LGBT summit being held this week in Philadelphia.

While the case has been in the courts since 2008, the city and the Cradle of Liberty Council have been discussing the scouts' policy on gays for a decade.

The city argued that the scouts, as an organization that discriminated based on sexual orientation, were violating city ordinance and could not receive the municipal benefit of their nominal $1 rent.

The city suggested that the scouts change the policy toward gays, pay market-rate rent, or move out.

The local scouts maintained that they could not change membership policies without being ejected by the national organization.

After losing the 2010 trial, the city had been on the hook to pay the scouts' legal bills, which eventually topped $1 million, though Harrington said the scouts had been represented pro bono by the firm Drinker, Biddle & Reath L.L.P.

The sides had sought a deal to settle the case and the legal bills by the city's selling the building to the scouts for $500,000, about half its appraised value.

That deal was scrapped in early 2012 because City Council approval was necessary and there was not enough support among the members.

Council approval is not required for the new settlement.

The city is not paying any of the scouts' legal bills. The money technically covers the costs of "improvements" made to the 13,000-square-foot Beaux Arts building at 21st and Winter Streets.

A 1928 city ordinance gave the scouts the right to build there and made the organization responsible for maintaining the property.

The building's next incarnation isn't clear.

"We'll determine what use the city puts the building to once the Boy Scouts are no longer in it," Smith said. "But we are not at that stage yet."