A few hours after praying at the temple, Rajapaksa, his family and members of the Sri Lankan delegation flew to Colombo amid tight security.
His two-day visit had been marred by protests by Tamil groups who denounced the president for not granting autonomy to Tamil areas and for human rights violations.
Rajapaksa, his wife Shiranthi and other family members had a 'darshan' of the resident deity early Saturday. They also took part in the 'Suprabhatha Seva', a pre-dawn ritual, temple officials said.
After visiting the temple, he told the media that India was a democratic country and everyone had a right to protest. "What can I do" This is a democratic country," he said, when asked about his reaction to the protests.
Asked about alleged right violations in Sri Lanka, he said: "Come and see for yourself what is happening there."
The president left the temple for Renigunta airport in a motorcade amid tight security and took off for Colombo in a special aircraft. The road from Tirumala Hills to the airport was closed for traffic. Security was beefed up along the route.
The president arrived in this temple town Friday evening. There were no protests in the temple town Saturday unlike Friday when a large number of Tamil activists from neighbouring Tamil Nadu tried to stall Rajapaksa's visit.
Earlier, priests offered 'prasadam' and the silk 'vastram' of the presiding deity to Rajapaksa. Temple officials also presented him a memento of the presiding deity.
Officials of Tirumala Tirupati Devasthanam (TTD), which manages the affairs of the famous temple, welcomed Rajapaksa.
Though as a VIP he was entitled to the 'Mahadwaram' entry, he opted to enter the temple through the 'Vaikuntam' queue complex like a common devotee. Rajapaksa spent Friday night at at TTD's Sri Padmavathi Guest House.