Afghanistan, once a bloody battlefield of the Cold War, is becoming deeply embroiled in a high-stakes rivalry between two regional powers -- Iran and Pakistan -- for influence over that fractious state at the crossroads of Central Asia.

Tensions in the region have been escalating rhetorically by the day -- and could explode into military conflict -- because of the killing of nine Iranian diplomats during intense civil warfare in northern Afghanistan last month. Furious at Afghanistan's foot-dragging on the matter, Tehran staged a massive military exercise along the Afghan border last week and has since said it will send 200,000 troops there, warning Monday that the threat of armed conflict is now "very huge and widespread."

But the diplomats' deaths are only one flash point in a much broader rivalry for ethnic and religious dominance, economic advantage, geographic access and international influence that has split Afghanistan into Iranian and Pakistani spheres of influence. Until now, that influence has been largely covert and unacknowledged, but developments are fast causing knuckles to be bared on all sides.

"This marks a return to the regionalization of the Afghan conflict which we have not seen since 1979," when the Soviet Union invaded Afghanistan, said Rifaat Hussain, a professor of international relations at the University of Islamabad. "I don't think Iran will do anything rash, but the relationship between Iran and Pakistan has unraveled, and all of its contradictions are now coming into play."

Both Iran and Pakistan, which only months ago were working together to promote reconciliation among Afghans, have accused each other of providing military and intelligence support to various Afghan factions. Each has charged the other with engaging in a cynical bid for economic and political hegemony in the region, backing opposite sides in the struggle between the radical Taliban movement and its opponents to obtain control over strategic commercial routes and oil and gas pipelines into the neighboring former Soviet republics of Central Asia.

The Pakistani-backed Taliban has gained the upper hand in the past two years, seizing control of almost all of Afghanistan. The factions opposing the Taliban -- a disparate alliance backed by Iran -- have vowed to keep fighting, but they have been effectively defeated in all but three of Afghanistan's 32 provinces.

One of the Taliban's most significant battlefield victories -- last weekend's capture of the city of Bamiyan, a key opposition stronghold -- reflected not only the Taliban's increasing dominance over its opponents but also the heightened tension between the two sides' backers.

Taliban officials accused Iran of providing military support to the opposition forces; Tehran radio accused Pakistan of sending its air force to bomb the city in support of the Taliban's advance and said Iran was holding Pakistan responsible for what it termed war crimes at Bamiyan. Pakistan has denied that accusation and previous allegations of direct involvement in the Afghan conflict.

Also fueling the volatile situation are ethnic and religious rivalries between the Taliban, who are Sunni Muslims of Afghanistan's dominant Pashtun ethnic group, and the opposition factions, many of which represent other ethnic groups or include Shiite Muslims. Iran, a Shiite Muslim state, has a strong interest in promoting that sect; Pakistan, one of the Taliban's few international allies, is about 80 percent Sunni.

"There is no doubt that Pakistan has a deep strategic involvement in Afghanistan now. The Taliban are their Trojan horse," Hussain said. At the same time, he added, "there is now strong circumstantial evidence that Iran has been arming the Shiites. These tensions are sectarian as well as economic."

The slayings of the Iranian diplomats, apparently at the hands of the Taliban, have raised the possibility that Iran might directly intervene in Afghanistan. In the past week, Tehran has issued a bewildering mix of restrained and belligerent statements, with some leaders vowing vengeance for the diplomats' killings and army officials saying they are prepared to give Afghanistan "a beating." Today, Ayatollah Ali Khamenei, Iran's spiritual leader and commander in chief of its half-million-member armed forces, put the military on high alert, according to the Reuters news agency.

Pakistan, on the other hand, has given no indication that its forces would become directly involved in such a conflict. Some observers suggest that Iran's armed forces, although superior in number, are no match for the Taliban's seasoned guerrilla fighters. Others say Iran might use its military exercises as a cover to send some armed Afghan refugees across the border to cause trouble.

Officials of the Taliban predicted that Iran would not dare attack, noting the losses that Iranian-backed opposition forces inside Afghanistan have suffered.

"Iran's investments in our country have been lost, and their puppets have been defeated," said Abdullah Hakim Mujahid, a Taliban diplomat and former Afghan ambassador to Pakistan. "They would be very mistaken to intervene, because Afghanistan has defeated two superpowers this century, and this would make a great lesson for them too."

Pakistan and Iran are not the only foreign powers with a stake in the current Afghan crisis. The United States is part of the equation too, although its relations with the regional players are a mass of contradictions.

After the Soviet takeover of Afghanistan in 1979, Afghan guerrillas -- backed by Pakistan and the United States -- fought the occupation for a decade, inflicting such a heavy toll that the Soviet forces pulled out in 1989. The power vacuum created by their withdrawal, however, led to protracted factional fighting in which the Taliban has gained the upper hand in the last two years.

Despite the longtime alliance between Washington and Islamabad, however, the Clinton administration slapped economic sanctions on Pakistan after it exploded six nuclear devices in May. The United States also provoked widespread protests in Pakistan last month by attacking Sudan and Afghanistan with cruise missiles in retaliation for terrorist bombings at two U.S. embassies in East Africa.

The Taliban came to power partly as a result of U.S. support for the anti-Soviet rebel groups. Current relations between Washington and the Taliban are cool because of the Taliban's willingness to play host to renegade Saudi terrorist Osama bin Laden, whose camps were the target of the Aug. 21 American missile attack, as well as its suppression of women's rights and other freedoms and its tolerance of drug trafficking. Yet the United States also has frosty relations with Iran -- dating to the Islamic revolution of 1979 and the takeover of the U.S. Embassy in Tehran.