History of the temple is unclear. In the early 18th century, King Vijayaraya Chakkaravarthi built the present day form of the temple. There is scant history of the period before that though it is believed that the locals worship the Goddess for many centuries before building the current temple. One legend says that the present deity was at the Ranganathaswamy temple at Srirangam, and one of chief priests of the temple believed that the idol caused him illness and hence asked it to be removed from the temple. It is a common belief in that part of the region that such local Gods have immense powers and they must always be satisfied by proper offerings and sacrifices. The idol was moved outside Srirangam, and later found by some of the passerby who built a temple named, the Kannanur Mariamman temple.
During that period (around the 17th century CE), Trichi was ruled by the Vijayanagar kings and the area was used as an army base. It is believed that they made a commitment to build the temple if they win the war and after attaining success they built a shrine for the Goddess. Originally it was under the management of the Thiruvanaikaval temple, a popular one in the region. Later, the control was split and currently Samayapuram is under an independent trust monitored by the Government of Tamil Nadu, which also monitors the annadanam distribution (an act of offering food to the devotees).