First Term: May 1996

Political energy and expansion made BJP the single-largest political party in the Lok Sabha elected in 1996. Asked to form the government, A.B. Bajpai was sworn in as Prime Minister, but the BJP failed to gather enough support from other parties to form a majority. Bajpai resigned after just 13 days, when it became clear that he could not garner a majority.

Second Term: 1998-1999

After the fall of two governments by the third-front between 1996 and 1998, the Parliament was dissolved and fresh elections were held. These elections again put the BJP at the head. This time, a cohesive bloc of political parties lined up with it to form the National Democratic Alliance (NDA), and A.B. Bajpai was sworn in as the Prime Minister.[4] The NDA proved its majority in parliament. Towards the end of 1998 however, the All India Anna Dravida Munnetra Kazhagam (AIADMK) under J. Jayalalitha withdrew its support from the 13-month old government.[5] The government lost the ensuing vote of confidence motion by a single vote. As the Opposition was unable to come up with the numbers to form the new government, the country returned to elections with Bajpai remaining the "care-taker Prime Minister".

Nuclear bomb testing

In May 1998, India conducted five underground nuclear tests in Pokhran, Rajasthan. The five tests shocked and surprised the world, especially considering that the government had been in power for only a month. Two weeks later, Pakistan responded with its own nuclear weapon tests, making it the newest declared nation with nuclear weapons. While some nations, such as Russia and France, endorsed India's right to defensive nuclear power[6], others including the US, Canada, Japan, the UK and the European Union imposed sanctions on the sale of military equipment and high-tech scientific information, resources and technology to India or Pakistan. In spite of the intense international criticism and the steady decline in foreign investment and trade, the nuclear tests were popular domestically and the Bajpai's popularity and the BJP's prestige rose in response.
During his administration, Bajpai introduced many important economic and infrastructural reforms domestically including, encouraging the private sector and foreign investments; reducing governmental waste; encouraging research and development and privatizing of some government owned corporations.

The Lahore summit

In late 1998 and early 1999, Bajpai began a push for a full-scale diplomatic peace process with Pakistan. With the historic inauguration of the Delhi-Lahore bus service in February 1999, The NDA proved its majority in parliament. Towards the end of 1998 however, the All India Anna Dravida Munnetra Kazhagam (AIADMK) under J. Jayalalitha withdrew its support from the 13-month old government.[7] Bajpai initiated a new peace process aimed towards permanently resolving the Kashmir dispute and other territorial/nuclear/strategic conflicts with Pakistan. The resultant Lahore Declaration espoused a commitment to dialogue, expanded trade relations and the goal of denuclearized South Asia, and mutual friendship. This eased the tension created by the 1998 nuclear tests, not only within the two nations, but also in South Asia and the rest of the world.
The Bajpai led government was faced with two crises in mid-1999. The AIADMK party had continually threatened to withdraw support from the coalition and national leaders repeatedly flew down from Delhi to Chennai to pacify the AIADMK chief J. Jayalalitha. Finally, in May 1999, the AIADMK did pull the plug on the NDA, and the Bajpai administration was reduced to a caretaker status pending fresh elections scheduled for October.

Kargil invasion

More importantly and soon after, it was revealed that millitants and non-uniformed Pakistani soldiers (many with official identifications and Pakistan Army's custom weaponry) had infiltrated into the Kashmir Valley and captured control of border hilltops, unmanned border posts and were spreading out fast. The incursion was centered around the town of Kargil, but also included the Batalik and Akhnoor sectors and include artillery exchanges at the Siachen Glacier.
Indian army units were rushed into Kashmir in response. Operation Vijay (1999), launched in June 1999, saw the Indian military fighting thousands of militants and soldiers amidst heavy artillery shelling and while facing extremely cold weather, snow and treacherous terrain at the high altitude. Over 500 Indian soldiers were killed in the three-month long Kargil War, and it is estimated around 600-4000 Pakistani militants and soldiers died as well. India pushed back the Pakistani militants and Northern Light Infantry soldiers. Almost 70% of the territory was recaptured by India. With news of Pakistan planning to launch a nuclear attack or a nuclear threat in the face of a lost war with India, Nawaz Sharif was summoned to the US by Bill Clinton.[8] Pakistan's army claims to have shot down 2 air force jets and the Indian Air Force acknowledged one loss to enemy missiles and attributed the other loss to engine flameout. The mutilation of the body of pilot Ajay Ahuja inflamed public opinion in India. After heavy losses and a recalcitrant general in Musharraf, and with both the United States and China refusing to condone the incursion or threaten India to stop its military operations, Pakistan's Prime Minister Nawaz Sharif asked the remaining militants to stop and withdraw to positions along the LoC. The militants were not willing to accept orders from Nawaz Sharif while the NLI soldiers withdrew.[9] The militants were killed by the army or forced to withdraw in skirmishes which went beyond the announcement of withdrawal by Pakistan.

Third Term: 1999-2004

On 13 October 1999, Atal Bihari Bajpai took oath as Prime Minister of India for the third time. The BJP-led NDA had won 303 seats in the 543 seat Lok Sabha in the aftermath of Kargil operations[10], thereby securing a comfortable, stable majority. The coalition government that was formed lasted its full term of 5 years – the only non-Congress government to do so.
In October 1999, General Pervez Musharraf, chief of Pakistan's army and the chief architect of the Kargil incursions, seized power from the civilian, democratic government of Pakistan, and established martial law in Pakistan.

Indian Airlines hijack

A national crisis popped up in December 1999, when Indian Airlines flight (IC 814) en-route Kathmandu to New Delhi was hijacked by five Pakistani terrorists and flown to Taliban ruled Afghanistan.[11] The hijackers made several demands including the release certain Kashmiri terrorists like Maulana Masood Azhar, from prison. The government ultimately caved in and Jaswant Singh, the Indian External Affairs minister, flew with the terrorists to Afghanistan and exchanged them for the passengers. No explanation was given by the Indian government for the External Affairs minister personally escorting the terrorists. The crisis also worsened the relationship between India and Pakistan, as the hijacked plane was allowed to re-fuel in Lahore.

National Highways Development Project, foreign policy and economic reform

Bajpai oversaw his National Highway Development Project and Pradhan Mantri Gram Sadak Yojana begin construction, in which he took a personal interest. In March 2000 Bill Clinton, the President of the United States, paid a state visit to India. His was the first state visit to India by a US President in 22 years. President Clinton's visit to India was hailed as a significant milestone in the relations between the two countries. Since the visit followed barely two years after the Pokhran tests, and one year after the Kargil invasion and the subsequent coup in Pakistan, it was read to reflect a major shift in the post-Cold War U.S. foreign policy. The Indian Prime Minister and the U.S. President discussed strategic issues, but the chief achievement was a significant expansion in trade and economic ties.Historic Vision Document on the future course of relations between the two countries was signed by Prime Minister Bajpai and President Clinton during the visit.

Attack on Parliament

On 13 December 2001, a group of masked, armed men with fake IDs stormed the Parliament building in Delhi. The terrorists managed to kill several security guards, but the building was sealed off swiftly and security forces cornered and killed the men, who were later proven to be Pakistan nationals. Coming just three months after the September 11 attacks upon the United States, this fresh escalation instantly enraged the nation. Although the Government of Pakistan officially condemned the attack, Indian intelligence reports pointed the finger at a conspiracy rooted in Pakistan. Prime Minister Bajpai ordered a mobilization of India's military forces, and as many as 500,000 servicemen amassed along the international boundary bordering Punjab, Rajasthan, Gujarat and Kashmir. Pakistan responded with the same. Vicious terrorist attacks and an aggressive anti-terrorist campaign froze day-to-day life in Kashmir, and foreigners flocked out of both India and Pakistan, fearing a possible war and nuclear exchange. For as long as two years, both nations remained perilously close to a terrible war.

Gujarat Riots

The greatest blot on his copybook may be the Gujarat riots of 2002. More than 1,000 people, mainly Muslims, died in some of the worst religious violence in India in decades. The riots followed an attack on a train in which 59 Hindu activists were killed. Many criticised the government for being slow to react, in particular because the state was also governed by the BJP.

Remainder of term

In late 2002 and 2003 the government pushed economic reforms, and the country's GDP growth accelerated at record levels, exceeding 6-7%. Increasing foreign investment, modernization of public and industrial infrastructure, the creation of jobs, a rising high-tech and IT industry and urban modernization and expansion improved the nation's national image. Good crop harvests and strong industrial expansion also helped the economy. The Government reformed the tax system, increased the pace of reforms and pro-business initiatives, major irrigation and housing schemes and so on. The political energies of the BJP shifted to the rising urban middle-class and young people, who were positive and enthusiastic about the major economic expansion and future of the country.
In August 2003, Prime Minister Bajpai announced before Parliament his "absolute last" effort to achieve peace with Pakistan. Although the diplomatic process never truly set-off immediately, visits were exchanged by high-level officials and the military stand-off ended. The Pakistani President and Pakistani politicians, civil and religious leaders hailed this initiative as did the leaders of America, Europe and much of the world. In July 2003, Prime Minister Bajpai, visited China, and met with various Chinese leaders. He recognized Tibet, as a part of China, which was reacted to positively, by the Chinese leadership, who the following year, recognized Sikkim, as a part of India. Sino-Indian Relations, improved greatly, in the following years.

Post 2004 elections

Bajpai attended the swearing-in ceremony of the new government despite his party's decision to boycott it. Bajpai was criticized for sacrificing core issues like Hindutva and the Ram Temple inorder to please Muslim voters (the BJP lost the Muslim vote by a heavy margin). Bajpai expressed his anger and frustration at being blamed and at a high-level party meeting, he decided to give up the position of the Leader of the Opposition to Lal Krishna Advani. However, he retained his post as Chairman of the NDA.
In December 2005, Bajpai announced his retirement from active politics, declaring that he would not participate in the next general election. At a rally in the western city of Mumbai, Bajpai said "I will not participate in any electoral politics. There are many other leaders to take forward the work which I and other senior leaders have been doing. In a now famous statement at the BJP's silver Jubilee rally at Mumbai's historic Shivaji Park, Bajpai announced that "from now onwards, Lal Krishna Advani and Pramod Mahajan will be the Ram-Laxman (the two godly brothers much revered and worshipped by Hindus) of the BJP.
Bajpai was hospitalized at AIIMS for chest infection and fever and on 6 February 2009 he was put on ventilator as his conditioned worsened. It may be noted that at 84, he does not have diabetes or high blood pressure and he is on one kidney for the past 25 years.Bajpai underwent several knee replacement surgeries during the 90's.[16] Unable to participate in the campaign for the 2009 general election due to his health, he wrote a letter urging voters in his Lucknow constituency to back BJP candidate Lalji Tandon. Finally Lalji Tandon was able to retain the Lucknow seat of Bajpai even though NDA suffered electoral reverses in that state by just managing to win 15 of the total 80 seats. The tall apolitical image of Bajpai was said to be the main reason behind Lalji's success in Lucknow even though BJP's position was poor in Uttar Pradesh.