The warning appeared to be aimed directly at Pakistan, which said on Saturday it would lend its full support to international efforts to combat terrorism following intense US pressure.
Correspondents say scores of Afghans are now trying to leave the country.
Iran has just sealed off its 900km border with Afghanistan to stop a fresh influx of refugees from a country which has already suffered decades of civil war, famine, and currently drought.
Click here to see a map of Afghanistan
Pakistan has not specified whether it would allow the US to use its airspace or ground facilities for an attack on Afghanistan, but the Taleban has made clear that any countries offering such assistance must accept the possibility of reprise.
Sacrifice for Islam
Speaking to reporters in Pakistan, Taleban ambassador Abdul Salam Zaeef said a strike by the US could lead to a regional war.
"If any regional or neighbouring country helps the United States attack us it would spark extraordinary dangers... It would draw us into a reprisal war."
The Taleban leader, Mullah Omah, meanwhile declared that all Muslims both at home and abroad should stand up and fight for the Islamic state.
"All the Muslims in the world should support their Islam and their own belief, should defend Afghanistan... and should be ready to make a sacrifice for Islam," he said on the Voice of Shariyat Radio.
The authorities have also told foreign nationals to leave the country for their own safety.
A statement issued by the Afghan foreign ministry said Washington intended to use the presence of Osama bin Laden in Afghanistan as a pretext for an attack.
"In view of the current situation, all foreign nationals are therefore asked to leave Afghanistan temporarily," it said.
Desperate preparation
Reports from Iran say Taleban leaders and their families are withdrawing to the area around the southern province of Kandahar, where they would be hard to find or attack.
Earlier, a senior Taleban spokesman, Abdul Hai Mutmaen, said Afghans were ready to pay any price to defend themselves and use any all means to "take revenge".
Pakistan, which shares a 2,510 kilometre (1,560 mile) border with Afghanistan, has traditionally been the Taleban's strongest supporter and one of only three countries which recognise the regime.
The Taleban has rallied behind Mr Bin Laden, saying he lacked the capacity to launch such devastating attacks.
Some reports say Taleban soldiers have been digging trenches as protection against US attacks, and installing anti-aircraft guns and missiles.
But the BBC's Rahimullah Yusufzai in Peshawar says they are hopelessly ill-equipped to defend themselves against the Americans.
There is also a fear that, with the pull-out of international aid agencies in anticipation of an attack, Afghans will be left even more vulnerable.
After more than 20 years of war, the country is now suffering the worst drought in decades, and hundreds of thousands of people are living in refugee camps.
The World Food Programme has warned that up to 1.5 million Afghans could flood out of the country in search of food.
"We'll be looking at thousands, hundreds of thousands, even millions of deaths if we don't take action now," Christian Aid spokesman Dominic Nunn told the BBC.
Afghans are the single biggest refugee group in the world with more than 2.6 million in exile, mainly in Pakistan and Iran.
Related to this story:
Pakistan 'will comply' on terror
(15 Sep 01 | South Asia)
Afghan refugees' unending plight
(11 Jan 01 | South Asia)
Bin Laden denies blame
(12 Sep 01 | South Asia)
Bin Laden's command structure
(14 Sep 01 | Americas)
Taleban tense as US seeks targets
(12 Sep 01 | South Asia)
Who is Osama Bin Laden?
(11 Sep 01 | South Asia)
Aid agencies warn of Afghan crisis
(14 Sep 01 | South Asia)