As per the Sthala Purana the place where the temple stands today was once a dense forest that was inhabited by tribals. Among these tribals there was a notorious dacoit by name Kannappan. He was a terror for the common masses there. One day he brought a cow home to kill for food. The cow however, tore itself free and escaped into the jungle. He tried to trace it but failed. He the returned home disappointed but was surprised upon seeing his daughter caressing the same cow. The daughter would not allow her father to kill the cow. Layer his only daughter also died. This incident took a toll on him and he renounced all the worldly pleasures and immersed himself in worshipping god. One day Kannappan saw a dream where Mother Shakti appeared before him and told him that she was the cow which brought about the transformation within him. She then instructed him to build a temple in the cowshed. The next morning Kannappan repaired the shed and found the idols of Lord Vishnu and Mother Shakti. He built a temple and spent the rest of his life in the worship of the Devi. The temple was well maintained by him but later after his death it fell in ruins as the place became uninhabited.
One day a Pulaya (outcaste) woman came near the temple to cut grass with her scythe. Accidentally she struck against a stone which started to ooze blood. The woman was horrified at the sight and began shouting loudly. The Pulayas in the neighbourhood came running to the spot. They then informed the learned Edathu Nambudiri, who came to visit the spot. He soon realised that there was divine Chaitanya of Parasakti at the place. He bought a garland and worshipped. Some other Nambudiris gathered and it was decided that the stone be worshipped as Devi and the adjoining one as Vishnu and both together as Lakshmi Narayana. The spot where the goddess appeared first is the present Pavi-zhamallithara on the south side of the temple.
Later the temple was built and the administration work was carried out by Edathu Nambudiri. In 1064 the Cochin Government took over the management of the temple. The rulers of Cochin were great devotees of the Bhagawati. They repaired and renovated the temple and brought about many improvements. The nalambalam, srikoil, mandapam etc. were renovated and their roof covered with copper plates. The golden flagstaff was also installed by them besides building anapandal, bhajana pura (shed for bhajan) etc.
Today the temple is under the administrative control of the Cochin Devaswom Board. The temple has now become a popular pilgrimage centre. It can easily be reached by bus from Ernakulam or Tripunithura.