India's Narendra Modi made a surprise visit to Pakistan on Friday, his first such trip as prime minister to this Islamic nation that has been India's long-standing archrival in the region.

The previously unannounced visit is a potential sign of thawing relations between the two nuclear-armed neighbours. The two heads of government also had an unscheduled meeting at the Paris climate change talks earlier this month.

Since gaining independence from Britain in 1947, India and Pakistan have fought three wars, two of them over Kashmir, the Himalayan region that both countries claim.

Modi landed on Friday afternoon in the eastern city of Lahore and met with his Pakistani counterpart Nawaz Sharif, state-run media reported. The visit coincides with Sharif's birthday and the wedding of his granddaughter.

Security was beefed up at the Lahore International Airport shortly before Modi's arrival.

Russia India

Indian Prime Minister Narendra Modi watches a wreath-laying ceremony in Moscow on Thursday. During his two-day official visit Modi signed a major deal with President Vladimir Putin to help build six nuclear reactors in India. (Vasily Maximov/Pool photo via AP)

After spending about two hours with Modi at his residence, Sharif went to the Lahore airport to see Modi off.

Sharif and Modi held a meeting in a "cordial and positive atmosphere," and they agreed to continue working for the welfare of people of their countries, Foreign Secretary Aizaz Ahmad Chaudhry told reporters.

He said Modi called Sharif at about 11:30 a.m. on Friday and expressed his wish to visit Pakistan

'Suddenly planned'

"This is how this visit was suddenly planned," he said. Chaudhry termed Modi's visit a "gesture of good will" and hoped that it will help resolve all of their outstanding issues when the two sides resume talks in the near future.

Earlier in the day, Pakistani Foreign Ministry spokesman Qazi Khalilullah said India had informed Pakistan about the visit on Friday. He refused to share any further details.

One of the first public signs of the visit came Friday morning when Modi, during a stop in the Afghan capital of Kabul, tweeted that he is "looking forward to meeting" Sharif in Lahore, "where I will drop by on my way back to Delhi." He said he also called Sharif and wished him happy birthday.

Sharif's sprawling residence had been colourfully decorated for his granddaughter's wedding reception when Modi arrived along with the Pakistani prime minister. The two leaders were later shown sitting together in a room looking happy and relaxed.

Analysts viewed the visit as a potential turning point in Pakistani-Indian relations.

"I think it is going to play a significant role in improving ties between the two South Asian archrivals," said Amanullah Memon, a professor of international relations at Preston University in the Pakistani capital, Islamabad.

'Positive step'

Amitabh Matto, an Indian foreign policy expert, described Modi's birthday diplomacy visit as a "very positive step."

"Any step toward trying to stabilize and provide a new beginning to India-Pakistan ties is welcome and needs to be supported by all those who believe that India and Pakistan have a common destiny and it is in their interest to fight together their common problems, including terrorism and economic under-development," he said.

However Modi faced criticism from the main Indian opposition Congress Party as well.

"Heads of state don't drop in to give Christmas or birthday greetings, particularly when you have such a history of complex issues between the two countries. It should have been a proper structured state visit. We would have welcomed it," said Anand Sharma, a Congress Party spokesman.

Effigy burned

Members of the Indian Youth Congress in New Delhi also staged a protest against the visit, during which they burned an effigy of Modi.

After a year of rising tensions, top security officials from India and Pakistan held talks in Thailand's capital earlier in December, discussing a range of issues, including Kashmir and ways to maintain peace along the countries' shared border. Also, two weeks ago, Indian External Affairs Minister Sushma Swaraj visited Pakistan to attend a meeting on Afghanistan.

India accuses Pakistan of arming and training insurgents fighting for Kashmir's independence from India or its merger with Pakistan, a charge Islamabad denies. More than 68,000 people have been killed in Kashmir violence, which began in 1989.

A cease-fire along the so-called "line of control" that serves as the border between Indian and Pakistani-held Kashmir has largely held since 2003, but cross-border firing and minor skirmishes are fairly common, with each side routinely blaming the other.

Modi's return to India ended a busy week for the Indian leader.

On Thursday, he concluded a deal with Russian President Vladimir Putin to build at least six new nuclear power units in India in the next 20 years.  Putin also said that Moscow and New Delhi were successfully co-operating in production of Brahmos missiles and planned to produce jointly a new type of jet fighter and transport aircraft.

India Pakistan Protest

Members of the Indian Youth Congress in New Delhi burn an effigy of Indian Prime Minister Narendra Modi to protest his visit to Pakistan. (Altaf Qadri/Associated Press)