The Jerusalem District Court ruled evidence uncovered by police pointed to voting fraud that was organized "to the point of being systematic and even an 'industry'," the Times of Israel reported.
Moshe Abutbul, the ultra-Orthodox incumbent mayor of Beit Shemesh, beat secular challenger Eli Cohen by fewer than 1,000 votes, in an October election.
Cohen praised the court's decision, saying "democracy and justice have prevailed."
However, Aryeh Deri, chairman of the Shas party, of which Abutbul is a member, said he was disappointed in the ruling, charging it was based "on a media campaign."
Officials last month said they had discovered 200 identity cards in an apartment and car belonging to an Abutbul supporter, as well as a collection of clothing that appeared to be intended as disguises so people could vote multiple times.
Two people have been arrested. At least eight other people have been questioned.
Border police were dispatched to the town Thursday in anticipation of possible disturbances following the court ruling.