The area including Valanchery belongs to the erstwhile Valluvand Kingdom in 12th century. The Valluvanad rulers was a prominent presence in the central malabar with a wide area under their control. But, it was in around 1353-1356 AD, these places came under the rule of the Zamorin aka Samootiri from Kozhikode (Calicut). Samoothiri Raja fought a series of small battles with smaller states called the Thirunavaya War. Until then Valluvakonathiri was the strongest of the kings and had the right of presiding over the Mamankam Festival held once every 12 years at Thirunavaya. This right was usurped by Samoothiri when he captured the town in the latter half of the 13th century. As Thirunavaya was captured, Samoothiri proclaimed himself as the Rakshāpurusha (“protector”, effectively the Emperor) and took over sole right of conducting the Mamankam, a mock war festival. The next Mamankam at Thirunavaya was conducted under the auspices of Saamoothiri with great pomp and splendor.

Courtesy: Wikipedia