Convoys of brightly painted trucks chug along the highway from the nearby border with Iran, groaning under impossible loads of rubber tires, cooking oil and sacks of grain. Some cargoes are destined for the Afghan capital, Kabul, which is desperately lacking in food and essential goods. Others are headed for Pakistan, where they will fetch much higher prices.

Until several weeks ago, there were no trucks. The Iran-Afghanistan border had been closed for more than a year because of political tensions, shutting off a major Central Asian trade route that had been plied for centuries, ever since camel caravans laden with spices and carpets began crisscrossing these strategic desert wastes.

But history has been a constant casualty of modern wars and revolutions in this arid neighborhood, where Iran's Shiite Muslims and Afghanistan's Sunni Muslims have fought and traded--sometimes both at once. Herat, a quintessential trading city, has been at the center of this ambivalent relationship, especially since the Taliban, a rigid Sunni movement, seized power in Kabul in 1996.

For the moment, politics and commerce are keeping a respectable distance from each other. Tehran reportedly is still backing an anti-Taliban militia group in northeastern Afghanistan, but it has just signed an agreement with Kabul to resume business. The Iranian consulate in Herat, closed and locked for the past year, is now teeming with activity and expecting the new consul any day.

The border opening has created a critical economic safety valve for the Taliban, coming just as the United Nations imposed sanctions urged by the United States and aimed at pressuring Kabul to turn over Osama bin Laden, an alleged Saudi terrorist living in Afghanistan. Prices of such basic goods as wheat, which had doubled in some Afghan cities after the sanctions were imposed Nov. 14, dropped just as dramatically when news of the border agreement spread.

"We appreciate very much that Iran is doing this good action," said Latifullah Hakkani, a senior Taliban official in Herat. "We cannot say that Iran has sympathy for the Islamic Emirate of Afghanistan, but if they have sympathy for the innocent people of Afghanistan, we appreciate it a lot."

Taliban radio and newspapers, reflecting the government's eagerness to quell popular discontent and panic in the wake of the sanctions, recently trumpeted reassuring stories about "large caravans of food" coming from Herat and declining prices. While praising Iran for its cooperation, Taliban media excoriated the United Nations as the craven "housemaid" of Washington and its "arrogant" policies.

For some local residents--especially the minority Shiite Muslim community, which has close ties with Iran and uneasy relations with local Taliban authorities--the border opening has personal and political significance. The stronger Iran's influence, the more the Shiites are free to observe their customs; women, for example, can switch from a restrictive, Taliban-style head-and-body veil to a loose black garment that allows their eyes to be exposed.

For most inhabitants though, the relaxation of commercial restrictions has simply brought some material comfort. Herat is a relatively prosperous city with boutiques that feature the latest fashions, shoes and cosmetics from the United Arab Emirates. But like other residents of Afghanistan, one of the world's poorest countries, they now face a harsh winter on top of sanctions restricting trade, travel, mail and overseas investment.

"This is very good news for the nation, and especially for the people of Herat. Prices have already come down 20 percent," said Wasir Ahmat, 25, a shopkeeper. "Iran claimed the Taliban were puppets of the United States, but now that was proven false. So now the border is open again, and we can all live in peace."

The border pact was reached just after a new military government in Pakistan, Afghanistan's other major trading partner, clamped down on border traffic to control smuggling. Some diplomats believe the timing was not coincidental, given the tense political relations and intense trade rivalry between Iran and Pakistan.

Whatever the reasons for Tehran's change of heart, the traders of Herat, masters at realpolitik, are breathing a sigh of relief as they negotiate new deals over Japanese calculators and pots of green tea.

"We don't know about the politics between the two countries. All we know is that one good neighbor suddenly became bad, and the other one suddenly opened up, thank God," said Ghulam Yahia, 21, the eldest son and assistant manager of one of Herat's major trading houses, which imports up to 50 shipping containers of cooking oil and other foodstuffs through Iran each month.

The border closure with Iran was triggered by the unexplained slayings of nine Iranian diplomats and an Iranian journalist in northern Afghanistan, where the Taliban is still challenged by rival factions. For months, traders such as Yahia had to reroute their shipments through neighboring Turkmenistan, which added hefty transit fees and many hours to each journey.

Moreover, for a few weeks last fall there was danger of a full-scale confrontation between Afghanistan and Iran, which launched high-profile military maneuvers near the border and placed its armed forces on alert--just as Afghanistan was reeling from U.S. missile attacks on several alleged terrorist training camps near its eastern border with Pakistan.

Now, Iran and Afghanistan appear to have put the diplomats' slayings behind them, but touchy issues remain. For years, Iran has been a major destination for refugees fleeing factional warfare in Afghanistan; at one point, more than 1 million had taken refuge there. About 200,000 still live in the nearby Iranian city of Mashhad, but recent returnees to Herat say their welcome in Iran was wearing thin.

Jalil Ayderi, 28, a tailor, said he lived in Mashhad for 15 years until a few weeks ago, when he was suddenly detained and told his resident permit had expired. His cousin, who sells sweaters here, said he too was suddenly expelled from Mashhad after police broke into his home five months ago.

"The Iran government doesn't want Afghan people there any more," said Ayderi, who described life in Mashhad as "a hundred percent better" than in Afghanistan. "They gave us all permanent identity cards, but now they are trying to get them back and expel us. They want to have good relations with the government now, but that's only a game to make money. I don't think they care about the Afghan people at all."

CAPTION: Iran's new influence in Herat has enabled some women there to switch from head-and-body veils to garments that leave their eyes exposed.