In February 1999, the Pakistani defence services chiefs, including Pervez Musharraf, called on then Indian Prime Minister Atal Bihari Vajpayee in Government House, Lahore. As the call concluded, a Pakistani minister emphatically told this writer that the government would not allow the army to disrupt the historic process initiated by the visit. Three months later, the guns boomed in Kargil.

Nawaz Sharif is reaching out to India in a gushing, warm Lahori embrace. But Delhi must not lose sight of the enduring realities of the Pakistani state. Howsoever much Sharif may wish that the Constitution be respected by all Pakistani institutions, the army will not give up its decisive role in the formulation of the country's security policies, nor its traditional reflexes towards India.

Undoubtedly, the elections were credible despite the violence. They are an important milestone in the political evolution of Pakistan. Two points stand out vis-a-vis the elections to the National Assembly.

First, they have diminished the spread of the PML(N) and the PPP. Sharif effectively represents only the Punjab - 118 of his 126 seats come from that province. The PPP with 31 seats is now effectively a Sindhi party, with only one seat in Punjab. And despite the fervour of the metropolitan youth, some subtle support from the intelligence agencies and media attention, the bulk of Imran Khan's 29 seats come from pockets of Khyber-Pakhtunkhwa, FATA and northern Punjab.

Significantly none of the three leading parties has won a single seat in Balochistan. Sharif will have to go in for a coalition both to impart a national character to his government and to address the ever-present anti-Punjab sentiment.

Second, Pakistani society is fractured as never before. Assertive and sharp religious sentiment based on imported Salafi and Wahhabi theological doctrines in Khyber-Pakhtunkhwa has led to the decimation of the ANP, the flag-bearer of Pakhtun nationalism. Anti-US sentiment prevails all over but is strongest in this province and northern Punjab. Imran Khan effectively tapped into these feelings.

In the major urban centres, a rise in social conservatism is competing with civil society's quest for a religiously moderate, just and progressive country. The election results also demonstrate that the Mohajirs continue to seek refuge in the MQM while in rural Sindh, the writ of the Waderas and the Pirs prevails. The hold of biradari sentiment determines voting patterns most notably in the Punjab. Balochistan's results reflect the many contradictions of that blighted province.

Now Sharif will have to confront far more formidable challenges of governance than those he faced during his two stints as prime minister in the 1990s. He has to restore the credibility of the state among the people as well as internationally. In the scorching heat of a Pakistani summer, with endless power cuts, his people will give him no honeymoon period. He will have to quickly address macroeconomic issues and, with the army's concurrence, evolve new approaches to eliminate the Pakistani Taliban and sectarian violence. He may be inclined to dialogue but how far can that go with groups who are so violent in the cause of Allah?

He was the army's protege, but in the 1990s, his father and he began to build a loyal group of senior officers. They succeeded for a while but finally the army hit back in 1999. Badly singed once, Sharif will now move circumspectly and avoid playing politics with the institution. He will also need to quietly develop a consensus on Ashfaq Kayani's successor; the army chief retires in six months. The army will also not allow Musharraf, in his farmhouse prison in Islamabad, to be humiliated beyond a point. Nor will it allow a real Kargil enquiry. Some skeletons are best left buried.

President Asif Ali Zardari's term ends in September but Sharif will have to reach a modus vivendi with him, for the Senate is likely to be under the former's control for the next two years. Chief Justice IftikharChaudhry, as much judge as politician, retires in seven months. A post-Chaudhry court may be vigorous but not as political as it is now.

Pakistan's fundamental external priority will be Afghanistan and the management of its relations with the US over the coming few years. Sharif was one with the army in consolidating Taliban rule in Afghanistan in the late 1990s. He will strongly stand by them as they pursue Pakistani interests in the wake of the US force drawdown.

The Saudis, always influential in Islamabad, will now be more so. They had persuaded Musharraf to send the Sharifs into exile in Saudi Arabia. They will perhaps counsel Sharif to tone down his anti-Musharraf rhetoric now that the elections are over. Will they truly act as intermediaries between the US and Pakistan in the Afghan context?

Lastly, how should India deal with Sharif? It should welcome a forward movement on trade, treatment of prisoners, people-to-people contacts and cooperation in areas such as agriculture and the environment. However, we should be conscious that the use of terror is a part of Pakistan's security doctrine against India and Sharif cannot change that. His views on Kashmir and other issues have also not been flexible.

Statecraft requires cold assessment, not exuberant emotion. Prime Minister Manmohan Singh and external affairs minister Salman Khurshid would do well to watch Sharif's swearing-in on television in their offices rather than in person in Aiwan-e-Sadr in Islamabad.