The mosque was built during the reign of Ibrahim Iskandar I. It took 2 years to construct the mosque. In terms of artistic excellence and construction technique using only interlocking coral stone assembly and lacquered woodwork, it is one of the finest coral stone buildings of the world.
It has been in continuous use since it was built. The mosque was reportedly built over an ancient temple which predated Islam.