Pakistan Army paved the way for reviving a stalled dialogue with India this year, officials said, a thaw leading to the first visit to Pakistan by an Indian premier in almost 12 years.Indian Prime Minister Narendra Modi's surprise trip to meet Prime Minister Nawaz Sharif on Friday raised hopes that stop-and-start negotiations between the nuclear-armed neighbors might finally mean progress after more than 65 years of hostility.Aides say the meeting was arranged directly between the two prime ministers on just a few hours' notice when Modi called to wish 66-year-old Sharif a happy birthday.But even before Modi arrived in the eastern city of Lahore, relations between the nuclear-armed rivals had begun to thaw, with a resumption of dialogue already in the offing.On Friday, Modi and Nawaz agreed that their foreign secretaries would meet in mid-January to restart talks.Officials say "ownership" of peace talks by the military and the appointment of a recently retired general as the national security adviser have given Pakistan renewed confidence to restart dialogue with India, including speaking about the thorny issue of terrorism."This round is different because there is backing from the top where it matters ... the army chief is himself on board," a top diplomat said before the visit.Army Chief General Raheel Sharif is said to be close to the new national security adviser, recently retired general Naseer Khan Janjua, who in October replaced civilian Sartaj Aziz, an ally of the prime minister.Many saw the move as strengthening the army's hand in talks with India, with the military remaining wary of a civilian government giving too much away."General Janjua has immense experience in these matters. He's the best man for the job and he has already proven to be an asset to this (peace) process," one member of Nawaz Sharif’s cabinet said earlier in December."It's only an added benefit that he has a direct line to the (army) chief," he added.A senior Indian official in New Delhi also said military backing for peace talks marked a major change, with Janjua's involvement as national security advisor a key sign that General Raheel supports resuming the dialogue.Direct contact between the two prime ministers is a major factor in thawing relations - they met on the sidelines of the Paris climate change summit last month. However officials said that true change only became possible after Janjua's appointment.Earlier this month, the national security advisers of both countries met in Bangkok, paving the way for Indian Foreign Minister Sushma Swaraj's visit to Pakistan for the Heart of Asia summit where she agreed to reopen dialogue with Pakistan, thereby resuming a process broken off since 2012.By contrast, Pakistan says the disputed territory of Kashmir is the paramount topic.With a military man having a greater say in the process, there is more confidence about discussing such sensitive topics, several officials said."I think in the past there was a hesitation from Pakistan, understandably, to talk about terrorism [with India] but that may have changed," the diplomat told Reuters."There is better division of labor. The real decision-making is happening behind the scenes. The rest is just optics."American pressureA close aide to Modi in India said US officials always push for reviving India-Pakistan talks and external pressure was not a factor."Modi-ji's visit to Pakistan was not dictated by America but it was planned to keep the national and regional interest in mind," the aide said, using a Hindi term of respect for the premier.A senior security official close to the talks process was wary when responding to the Modi visit."It is a positive step that he came ... definitely ... but we still have to move with caution," he said. "It's a new Modi in an old bottle; Nawaz Sharif should take it one sip at a time."