Image copyright EPA Image caption Mr Modi (right) arrived at Lahore airport before the two men went to Mr Sharif's nearby estate

Indian Prime Minister Narendra Modi has met his Pakistani counterpart Nawaz Sharif during a surprise visit to the Pakistani city of Lahore.

Mr Modi was returning to India from Afghanistan when he stopped off. The visit coincided with the Pakistani prime minister's birthday.

Mr Modi is the first Indian PM to visit Pakistan since 2004.

Tensions between the two nuclear-armed neighbours were high in recent years but relations have begun to improve.

The pair met briefly in Paris last month on the sidelines of the COP21 climate change conference.

The two men hugged after Mr Modi arrived at Allama Iqbal International Airport on Friday, before making their way to Mr Sharif's nearby estate.

Analysis - Shaimaa Khalil, BBC News, Kabul

The Twitter hashtags about Mr Modi's visit to Pakistan started almost as soon as he announced on social media that he was going to "drop by" to see Mr Sharif on his birthday after a visit to Kabul.

One of the more telling ones was #Xmasmiracle.

This was always going to be an historic event, but the spontaneous and personal nature of the visit took many by surprise.

The two men have a lot to discuss, including the decades-long conflict along the Kashmir border.

Many see Mr Modi's visit as a solid step in the warming of relations between the nuclear rivals but there's a long way to go before that is translated to actual peace on the borders.

There's of course criticism on both sides about this gesture. The opposition Congress party in India called it ridiculous. In Pakistan, many took to Twitter to say that Mr Modi was not welcome.

Neither side has released a statement on the substance of the talks, which lasted two hours.

After the meeting, Mr Modi left to return to India.

Flashpoint border

Mr Modi, a Hindu nationalist, came to power in 2014 and has tried to help raise India's international profile.

The two countries have fought three wars since independence from Britain in 1947, two of them over Kashmir.

Kashmir, claimed by both countries in its entirety, has been a flashpoint for more than 60 years.

A ceasefire agreed in 2003 remains in place, but the neighbours often accuse each other of violating it.