The police intervened as protestors entered the mosque and asked the devotees to leave after Friday prayers ended.
Local administrative officials has said the construction of the mosque was illegal and its removal would be done starting next Monday.
However, the worshippers claim that the mosque has been there for decades and is legal.
The protest came as a powerful leading Buddhist monk blamed the authorities for allegedly selling lands within the sacred Buddhist zone of Dambulla to non-Buddhist elements.
The authorities denied the charge. A similar protest in the area in 1992 couldn't prevent the construction of a five star hotel at Kandalama.
The hotel remains a leading eco tourism location in the island. About 7 per cent of Sri Lanka's 20 million people are Muslims.
About 74 per cent are Sinhalese, who are mostly Buddhists, while about 18 per cent are Tamils, who are predominantly Hindus or Christians.