Musharraf explained his decision in a 35-minute televised speech, before a scheduled day of protest.
The country's largest Islamic group has threatened a nationwide uprising and others have vowed to support the Taleban in a holy war if the US attacks Afghanistan.
Musharraf's stance runs the risk of the country's Army siding with fundamentalist groups and gaining control of Pakistan's nuclear arsenal.
Afghanistan's rulers have rushed thousands of troops to the Pakistan border since the US ultimatum to hand over bin Laden or face military retaliation.
Pakistan has supported the Taleban since the 1979 Soviet invasion of Afghanistan and ties are ethnic, as well as religious. It is one of only three countries to recognise the regime. The largest Afghan group, the Pathans, are ethnically linked to Pathan populations in Pakistan which have provided Taleban fighters.
In his address to the nation, General Musharraf said he believed the best way to save both Afghanistan and the Taleban was to stand with the international community against terrorism.
Pakistan was threatened with destruction as India exerted its influence to have Pakistan declared a terrorist state. The US-aligned move would boost the nation's security and help its economic recovery.
General Musharraf said the US did not plan war against Islam or the Afghan people.
The military Government is also motivated by the likelihood of economic aid from the US, Japan and the European Union. Interest payments on Pakistan's $US51 billion overseas debt use up three-fifths of state revenue.
Before the address, the leader of Pakistan's largest Islamic party, Maulana Fazlur Rehman, pledged a holy war if the Government helped a US attack on Afghanistan.
Hundreds of Islamic students protested in the north-western city of Peshawar, waving placards in support of bin Laden and Taleban leader Mullah Mohammad Omar. They said they would go to Afghanistan to support the jihad if the US attacked.
It followed protests earlier this week when thousands of students shouted anti-US slogans outside the US consulate in Karachi.
General Musharraf is relying on the fundamentalist groups remaining divided, and claimed in his speech that only 10 to 15 per cent of the population opposed his decision.
The country faced irresistible pressure from the US to support action against bin Laden, and arch-foe India was hellbent on exploiting its predicament.
India, which won the last of three wars with Pakistan in 1971, accuses its rival of financing and training terrorists in the disputed territory of Kashmir. It has offered the US use of Army and air bases as it anxiously watches the unfolding relationship between Washington and Islamabad.
Map: Opposing forces in the war against terror
Pictures: Day 1 | Day 2 | Brooklyn Bridge live webcam
Video
The fatal flights
Emergency telephone numbers:
United Airlines
: 0168 1800 932 8555
American Airlines
: 0168 1800 245 0999
NZ Ministry of Foreign Affairs and Trade
: 0800 872 111
US Embassy in Wellington (recorded info): 04 472 2068
Victims and survivors
How to donate to firefighters' fund