Congress party general secretary Rahul Gandhi and Andhra Pradesh Chief Minister Y S Rajasekhara Reddy prayed separately at the famous Lord Venkateshwara temple in Tirupati.
Gandhi, one of the key campaigners for the Congress party, made an unscheduled visit to the temple located on Tirumala Hills around midnight.
The young MP from Amethi reached the temple town Thursday night after addressing a series of election meetings in coastal Andhra and Rayalaseema regions.
Officials of Tirumala Tirupati Devasthanam (TTD), which manages the affairs of India's richest temple, said Gandhi spent 20 minutes during his first visit to the shrine.
The Congress leader had a night halt in the temple town and left for campaigning Friday morning.
YSR, as the chief minister is popularly known, also prayed at the temple after seeing off Gandhi. He later resumed campaigning in Rayalaseema.