Wearing a traditional Kerala white dhoti and a shawl, Modi was received at the temple gate by the authorities with a traditional poornakumbh.
Prime Minister Narendra Modi offered prayers at the famed Lord Krishna temple in Guruvayur on Saturday.
He also performed the thulabharam ritual for which the temple authorities had reportedly arranged over 100 kg of lotus flowers.
The ritual is an important offering to Lord Krishna wherein a person is weighed against a commodity such as flowers, grains, fruits and similar articles and the equal value or quantity is offered as donation.
In a tweet, the prime minister said that he prayed for the country's progress and prosperity at the "iconic" temple.
"The Guruvayur Temple is divine and magnificent. Prayed at this iconic Temple for the progress and prosperity of India," Modi tweeted.
He also posted a photo of himself performing the thulabharam ritual at the temple. "A blessed moment from the Guruvayur Temple," he wrote.
Modi also offered kadali fruit, lotus flowers and ghee to the deity, temple sources said.
The prime minister spent around 20 minutes inside the temple before returning to the nearby temple guest house by foot.
Wearing a traditional Kerala white dhoti and a shawl, Modi was received at the temple gate by the authorities with a traditional poornakumbh.
He was accompanied by Kerala Governor P Sathasivam, Union Minister of State for External Affairs V Muraleedharan and Kerala Devaswom Minister Kadakampally Surendran.
Modi took a three-minute walk to the temple from the nearby Sreevatsam guest house.
Security had been tightened in and around the temple since Friday in view of his visit.
Earlier, the prime minister reached in Guruvayur in a special naval helicopter from the Kochi naval airport at 9.50 a.m.
Modi later addressed an 'Abhinandan Sabha'-- a party meeting being organised by the Bharatiya Janata Party Kerala State committee.
This was Modi's first public meeting after assuming office as the prime minister for a second consecutive term.
He arrived in Kochi late Friday night and was received at the naval airport by Sathasivam, Muraleedharan and Surendran.
He stayed at the government guest house in Kochi.