Pervez Musharraf asked Taliban to surrender OBL unconditionally but Taliban refused. Pakistan and Russia are on record for opposing the invasion of Afghanistan and Iraq whereas Iran supported regime change in both Afghanistan (Taliban) and Iraq (Saddam). Pakistan was told in no uncertain terms that we will be bombed back to the Stone Age if he continue opposing.
We faced international pressure at the United Nations to implement United Nations Security Council Resolution 1267, 1333, 1363 which meant we had to handover Taliban leaders and support ISAF. There is not a lot of choice left here for Pakistan.
This is the full behind the scene story:
Prior to September 11, 2001, U.S. State Department officials were meeting with Iranian diplomats as part of the UN six-plus-two talks, which sought regional cooperation on policy issues concerning Afghanistan. Karl Inderfurth, the U.S. representative to these talks from 1997 to 2001, explains that on September 21, 1998, UN Secretary-General Kofi Annan convened for the first time a six-plus-two meeting at the ministerial level. While U.S. Secretary of State Madeleine Albright attended, Iranian Foreign Minister Kamal Kharrazi did not. Albright and Kharrazi would later meet in September 2000 during a sixplus-two meeting. In general, these meetings were "professional but not harmonious" because Washington and Tehran disagreed over Iran’s provision of support to the Northern Alliance, the main anti-Taliban resistance group. The United States was reluctant to become tangled in the Afghan war.
After the 9/11 attacks, the situation changed.
According to Kenneth Pollack, a former CIA intelligence analyst on the Middle East, while members of the six plus-two group, such as Russia and Pakistan, opposed a U.S. invasion of Afghanistan, Iran supported the plan.
Officials from the United States and Iran began meeting outside the six-plus-two forum to develop a plan to topple the Taliban.
These meetings became known as the Geneva Contact Group, and although the Germans, Italians and the United Nations provided some political cover for these discussions, the group’s focus was U.S.-Iran cooperation on Afghanistan.
Iran not only provided reliable intelligence regarding the Taliban, it arrested and deported hundredsof Al-Qaeda and Taliban fighters who had crossed into the country for sanctuary.
Pollack adds that the Iranian government also provided search and rescue for downed U.S. aircrew members. Iran permitted the offloading of humanitarian supplies at its port of Chah Bahar for transport into Afghanistan, and offered access to airfields near the Afghan border for use by U.S. transport aircraft. Iran also supported the initial discussions between the United States and the Northern Alliance, which enabled subsequent military success against the Taliban. After the fall of the Taliban regime in late 2001, Iran played a critical role in international efforts to establish a new Afghan government and pledged and honored commitments toward Afghanistan’s reconstruction. Through interaction with Iranian diplomats in this forum, U.S. officials succeeded in curbing the anti-U.S. activities of Iran's security and intelligence services inside Afghanistan.
Source: Middle East Policy Council
Iran's President Mohammad Khatami himself said they supported the invasion of Afghanistan and put together the invasion plan:
People in Kabul know all of these facts but they are backed by US so they sing a different tune.
Soviets invaded Afghanistan. PDPA didn't invite the Soviets. Amin and Taraki were both assasinated by Soviets.