PITTSBURGH  A federal judge on Thursday ordered the City of Pittsburgh to allow a group’s tent city protest during the Group of 20 meeting next week, but he denied two other requests for permits for demonstrations, saying the city’s goal of “protecting visiting foreign leaders is of the highest interest.”

The judge, Gary L. Lancaster of Federal District Court, made his ruling just over a week before the leaders of 20 of the world’s largest and emerging economies meet here in a gathering that has become a rallying point for a variety of protesters.

Six groups sued the city, state and federal governments last week after being denied permits after months of discussions.

Since their lawsuit was filed, the city granted permits to three of the groups: for an interfaith march by the G6 Billion group; for another march by the group Bail Out the People; and for permits for a group of artists to use a city park.