The last time an Indian leader visited neighboring Pakistan was in 2004. Modi and Sharif met informally on the sidelines of the UN climate talks in Paris this month and at a regional economic summit in central Russia in July.
"Infusing a positive spirit in the neighborhood. [Modi] departs from Pakistan after a few hours in Lahore," official spokesman Vikas Swarup tweeted.
A series of accompanying photographs depicted Modi walking on the tarmac alongside Sharif.
Ties between the neighboring countries have been strained for decades and exacerbated further over the summer amid renewed violence in the disputed border region of Kashmir and Jammu administered by India. The exchange of fire postponed national security level talks into early December.
Indian Foreign Minister Sushma Swaraj told Sputnik two weeks ago she was due to travel to Islamabad for a "Heart of Asia" regional conference on Afghanistan. Swaraj’s December 8-9 trip was a first ministerial-level visit by an Indian official to Pakistan since May 2014.
India and Pakistan trade accusations of regularly violating a 2003 ceasefire.