NEW DELHI - Prime Minister Narendra Modi broke with diplomatic protocol to pay a surprise visit to Pakistan leader Nawaz Sharif, betting his personal brand on his ability to reset troubled relations, Indian media and analysts said Saturday.

Spurning official talks in the capital Islamabad, India's leader chose instead to make an intimate trip to Sharif's ancestral residence near Lahore Friday, where he was celebrating his birthday and the wedding of his granddaughter.

A source present in the meeting said the leaders of the nuclear-armed arch-rival nations "chatted like old friends" as they ate vegetarian food, with the Indian premier telling Sharif, "Your sincerity is beyond doubt".

Modi's stunning decision to drop in for talks with Pakistan's leader - something ex-premier Manmohan Singh failed to achieve in ten years of power - was roundly welcomed in India, where it was seen as a calculated personal gamble.

"Modi has made clear he is willing to risk political capital to make peace," the Indian Express newspaper said, warning that any future attacks traced to Pakistan would invite "savage criticism".

The visit, announced by Modi on Twitter, gave the appearance of being spontaneous, with Sharif's foreign affairs adviser not able to reach Lahore in time. However, a senior Pakistan official told AFP that security had been planned days in advance.

While Indian media suggested Modi was the driving force behind the visit, a Pakistani official said it was Islamabad's idea to arrange a meeting ahead of formal diplomatic talks set for January.

"The goal behind this meeting was to humanise the other side by arranging a visit involving close family members," said the official, adding some of Sharif's cabinet had opposed the visit.

Television polls suggested most Indians welcomed the development while newspapers praised Modi's decision to avoid weighty expectations by staging an informal "stopover" on the way back from Kabul.

"Traditional build-up to an Indian PM's visit to Pakistan would have seen different interest groups bringing all kinds of pressure to bear," The Times of India said.

Yet members of the opposition Congress party denounced the "unpredictable" act, calling it un-statesmanlike, with some complaining such an important meeting should not have been announced on Twitter.

Others questioned whether the newfound friendship would translate into concrete progress on peace, thwarted by issues such as India's fear of more terror attacks and violence-plagued Kashmir.

In his 18 months in power Modi has shown huge confidence in his political skills, announcing economic policies himself and fronting a key state election campaign in Bihar - unsuccessfully - instead of fielding a candidate.

"Modi loves to spring surprises - he's disruptive, he's setting aside old taboos," Neelam Deo, a director at Gateway House think-tank in Mumbai told AFP.

"He's personalised diplomacy to an extent we haven't seen in India since (India's first prime minister) Jawaharlal Nehru in the 1950s," she said, adding the visit was likely part of a broader strategy.

In Pakistan, the population has largely backed efforts to bring peace between the two countries.

But in Azad Kashmir, where cross-border shelling has claimed dozens of lives since 2014, the mood was sceptical.

Aziz Ahmed, a refugee from Indian-held Kashmir called the meeting a "mere photo session". "Such meetings have been taking place in the past, but have proven useless after some time," he said in Muzaffarabad.

There were signs Pakistan's army was not happy about the visit, with criticism on pro-army Twitter accounts believed to be run by the military.

Modi and Sharif have had a stop-start diplomatic relationship since the Indian premier's surprise decision to invite Sharif to his inauguration in May 2014.

Reuters adds: "So, you have finally come," Sharif told Modi, according to a Pakistani foreign ministry official who was at the meeting.

"Yes, absolutely. I am here," Modi replied, according to the official.

Modi phoned Sharif earlier in the day to wish him on his birthday and asked if he could make a stop in Pakistan on his way home, Pakistan's top diplomat, Foreign Secretary Aizaz Chaudhry, told reporters.

"And the PM said to him, 'Please come, you are our guest, please come and have tea with me'," he said.

Modi and Sharif talked for about 90 minutes and shared an early evening meal before the Indian leader flew back home.

"Among the decisions taken was that ties between the two countries would be strengthened and also people-to-people contact would be strengthened so that the atmosphere can be created in which the peace process can move forward," Chaudhry said.

A spokesman at Sharif's office earlier told Reuters the two leaders were to discuss a range of bilateral issues, including the disputed Himalayan region of Kashmir.

A close aide to Modi said the visit was a spontaneous decision by the prime minister and National Security Adviser Ajit Doval, and that it should not be seen as a sudden shift in India's position.

"But yes, it's a clear signal that active engagement can be done at a quick pace," the aide said, declining to be identified.