"The Indian Prime Minister came to Lahore and gave us his few hours. It is high time the countries put aside their hostilities," Sharif said.
"Goodwill gestures are the solution to many an ill," he told reporters at Zhob airport in Balochistan.
Sharif also thanked Modi for visiting Lahore last week.
Modi had sprung a surprise when he visited Lahore on the occasion of Sharif's 66th birthday and his granddaughter's wedding on December 25.
The Pakistan premier's comments came a day after his Advisor on Foreign Affairs Sartaj Aziz said that foreign secretaries of India and Pakistan will meet in Islamabad on January 14-15 to prepare a schedule of meeting for the comprehensive dialogue covering Jammu and Kashmir and other issues.
Sharif also expressed optimism that India-Pakistan ties would improve in the days ahead and the "spirit of goodwill generated with Modi's visit will continue to prevail".