As per the story of the legend, Lim Ko Niao, a Chinese girl which came to Pattani by ship to look for Lim To Khiam, her elder brother who had got married with the Pattani Governor’s daughter, converted to Islam and ordered the construction of the Krue Se mosque. However, she was not successful in taking his brother back home. Therefore, after putting a curse impeding the roof of the mosque to be completed, she hanged herself on a cashewnut tree near the mosque and her brother buried her at this place.