Mr. Bloomberg made the announcement after visiting the park, Zuccotti Park, for the first time and informing the protesters in person that the cleaning would begin Friday, a statement released by his office said.

He cited deteriorating sanitary conditions as the reason the park’s owner, Brookfield Properties, wrote a letter to the city conveying its concerns “about its inability to clean the park and maintain it in a condition fit for public use.”

“The mayor is a strong believer in the First Amendment and believes that the protesters have a right to continue to protest,” Caswell Holloway, the deputy mayor for operations, said in a statement.

“At the same time, the last three weeks have created unsanitary conditions and considerable wear and tear on the park. This situation is not in the best interests of the protesters, residents or the city.”

Beka Economopoulos, an organizer with Occupy Wall Street, said that the protesters “have worked vigorously to ensure safe and sanitary conditions, and we recognize the importance of being good neighbors.”

She said she feared that the cleaning was a pretext “to end this occupation.”

The Bloomberg administration added that the park would be cleaned in stages, and that the protesters would be allowed to return to the areas that had been cleaned, “provided they abide by the rules that Brookfield has established for the park.”

It was not immediately clear how long the cleanup would take.

While Mr. Bloomberg has said that he believes the protesters have a right to congregate and that they would not be removed by the police if they obeyed the laws, he has also been critical of the protesters’ message, and the disruption they have caused in Lower Manhattan.