After the Soviet withdrawal from Afghanistan and subsequent victory for the Afghan mujahideen, the rivalry between Iran and Pakistan intensified as the mujahideen broke up into multiple factions, no longer needing a union against foreign invaders. After 1989, Iran and Pakistan's policies in Afghanistan became ever more divergent as Pakistan, under Benazir Bhutto, explicitly supported Taliban forces in Afghanistan during the civil wars that erupted after the Soviet-Afghan War ended. This resulted in a major breach, with Iran becoming closer to Pakistan's rival, India. Pakistan's unwavering and continuous support for the Sunni Taliban organization in Afghanistan after the Soviet withdrawal became a problem for Shi'a Iran which opposed a Taliban-controlled Afghanistan. The Pakistani-backed Taliban fought the Iranian-backed Northern Alliance in Afghanistan and gained control of 90 percent of the country, including the capital city of Kabul. The Taliban established the Islamic Emirate of Afghanistan and began imposing ultraconservative and radical Wahhabi rule. As noted by a Pakistani foreign service officer, it was difficult to maintain good relations with Israel, Saudi Arabia, the United States, and Iran at the same time, given each state's back-and-forth rivalry with another, and in particular, Iran's rivalry with all three. In 1995 Bhutto paid a lengthy state visit to Iran, which greatly relaxed relations. At a public meeting, she spoke highly of Iran and Iranian society. However, increasing activity by Shi'a militants in Pakistan strained relations further. This was followed by the Taliban's capture of the city of Mazar-i-Sharif in 1998, in which thousands of Shi'a Muslims were massacred, according to Amnesty International. The most serious breach in relations came in 1998, after Iran accused the Taliban government's forces of taking 11 Iranian diplomats, 35 Iranian truck drivers and an Iranian journalist hostage, and later executing all of them. Iran massed over 300,000 troops on the Afghan–Iranian border and threatened to invade Afghanistan to depose the Taliban, a government which it had never recognized. This strained Iran's relations with Pakistan, which continued to support the Taliban government. In May 1998, Pakistan conducted its first-ever nuclear weapons tests (codenamed Chagai-I), detonating five nuclear weapons at a controlled facility in its Balochistan province in response to Indian tests (codenamed Pokhran-II) a few days earlier, both events would later lead to U.N. sanctions on both Pakistan and India but did not stop either country from continuing to conduct more tests. Pakistan had now become the seventh country in the world to acquire nuclear weapons (after the United States, Soviet Union, United Kingdom, France, China and India). Pakistani Prime Minister Nawaz Sharif acknowledged Pakistan's nuclear capability and tests on 7 September 1997. Iran congratulated Pakistan for its nuclear testing.
