Wearing a saffron coloured kurta-pyjama with a shawl draped on his shoulder and forearm, Modi paid obeisance at Pashupatinath temple before leaving to meet President Ram Baran Yadav.
Modi is on a two-day visit to Nepal, a first by an Indian prime minister in 17 years. His visit ends Monday.
Regarded as the most sacred temple of Hindu Lord Shiva in the world, Pashupatinath temple's existence dates back to 400 A.D. The richly-ornamented pagoda houses the sacred linga or phallic symbol of Lord Shiva. Thousands of pilgrims from all over the world come here, the temple's web site said.
Brahmins welcomed Modi by chanting the Veda at the main gate of the temple.
The Pashupatinath temple management committee gifted Modi a picture of Pashupatinath.
Modi announced Rs.25 crore for the temple and the money will be spent to build a 400-bed Dharmashala in Pashupatinath area, according to member secretary of Pashupatinath Area Development Committee Govind Tondon.
Modi also gifted 2,500 kg of sandalwood.
Chief priest Ganesh Bhatta who performed the puja, offered a rare chandan paste prepared from four lingas of Pashupatinath. This is rare and only gifted to very important dignitaries, said Tondo.