(CNN) -- Israeli police officers razed a mosque they said was built illegally in the southern city of Rahat as residents hurled rocks at them.
Hundreds of police officers accompanied by land authority officials arrived in the city on Saturday night. They had bulldozers and trucks, and said they were carrying out a court order, according to Mayor Faiz Abu-Sahaban.
The mayor said residents built the mosque before they had permits.
However, he said, a "mosque is not something you can demolish, instead you can grant permits."
The mayor said resolving the issue through dialogue was better than razing the mosque.
"Demolitions bring only trouble," he said.
Residents protested the demolition and threw stones at the police, who used rubber bullets to disperse them, he said.
"This will only encourage the extremists," the mayor said. "We want to live in peace together. We don't want trouble, the aim is to prevent more destruction."
Residents started rebuilding the mosque Sunday morning, he said, and declared a strike in protest of the demolition.
Police spokesman Micky Rosenfeld said the mosque was razed early Sunday to honor a July court ruling.
Rosenfeld said five residents were arrested.
Rahat is home to more than 50,000 Bedouins and is just north of the southern city of Beer Sheva.
The Bedouins are an Arab Muslim minority and are citizens of Israel.They have lived in the Negev desert for centuries leading a Nomadic lifestyle.
Israel started to try and settle them in permanent towns a few decades ago. However half of them still live in unrecognized villages with no basic rights or municipal services.The other half who live in permanent towns are socially and economically disadvantaged with the lowest income in the country.