San Francisco police arrested seven people early Thursday as officers cleared a Hayes Valley camp of activists protesting a planned housing development.

Police arrived at a former community garden called the Hayes Valley Farm at 1:30 a.m. and ordered 55 people to leave, said Sgt. Dennis Toomer, a police spokesman.

All but five left without incident from the city-owned site at 450 Laguna St., Toomer said. Two of them were peacefully arrested on the ground, and officers removed three others from platforms in the trees.

One of the protesters fell from a tree onto foam padding that police had placed on the ground. The man was not badly hurt, but Toomer said he did not know the extent of his injuries.

The five were arrested on suspicion of trespassing and disorderly conduct, police said. Two other people were arrested outside the camp on suspicion of disorderly conduct.

Their names have not been released.

The activists were protesting a plan to turn the community garden into a 282-unit housing development. More than 100 units will be affordable for low-income residents, said Christine Falvey, a spokeswoman for Mayor Ed Lee.

The group that organized volunteer activities at the farm held its last event May 31, and the protesters arrived the next day and set up camp. They called the space "Gezi Gardens" after a park in Istanbul that has been the site of recent protests.

Protesters said the police action had caught them by surprise.

"If we'd known, we could have been better prepared than we were," said Ryan Rising, 24, a protester. "We have seven tree platforms and only had three people in them - we could have had more people in the trees."

Rising said developers shouldn't be bulldozing green space to build more housing when the city has at least 30,000 empty residences, a statistic he cited from the 2010 U.S. census.

"If there's a housing crisis in San Francisco, it's because of that," he said.

One Laguna Street resident who had asked for the protesters to be removed applauded the raid.

"I got my way," said Brad Ramsey, 51. "The Hayes Valley Farm was fine - the freaks after them didn't live here. I talked to my (city) supervisor, talked to police. It finally did some good."