The mosque dates back to the
Pattani Kingdom, when it was ruled by a
sultan. The villagers in that area who were both
Muslims and
Buddhists built the mosque in 1634. They cooperated in the construction of the mosque. Legend states that during the war between the
Ayutthaya Kingdom and the Pattani Kingdom, a young woman of a village in the Pattani Kingdom was fleeing from the war. She was the keeper of the village's
Quran and fled with it in her hands. Upon fleeing, she fell into a small valley. Rescued by the villagers in that area, she surprised them as she had the Quran tight in her hands. The villagers so then decided to build the Mosque after the war ended. The hand-written Quran and the construction plan of the mosque are kept in the mosque itself. ==Architecture==