Peshawar, capital of Pakistan's North-West Frontier Province, is one of those volatile, vaguely hazardous cities -- think of Erzurum, in eastern Turkey, or northern Thailand's Chiang Mai -- that lie on or near borders, along historical, political and ethnic fault lines. Whatever else these cities are, they are seldom dull: Intrigue boils and bubbles just beneath the surface of everyday life, an underworld of exiles, border jumpers, smugglers and spies, plotters and schemers, black and gray marketeers.

Peshawar owes much of its volatility, past and present, to its native population: This is the great city, the unofficial capital, of the Pathans, a tribal people whose way of life is built around honor, chivalry and feudal warfare. King Arthur's knights, with Kalashnikovs instead of swords and rocket launchers in place of lances.

But their dangerous edge aside, the Pathans live according to a strict, and quite lovely, code of conduct collectively called Pushtunvalli, and if violence is an important part of it, even more important are the concepts of honesty, kindness to strangers and hospitality.

Guns, tempers and all, these are marvelous people. Merchants invite you into their shops, not to sell, just to talk, trade stories, drink tea, pass the time of day. The scooter-cab driver takes a 10-rupee (10-cent) note from you for a ride across town, smiles, shakes his head and carefully counts out four rupee notes in change; give him two back for a tip, and he beams and blesses you before driving away. Hire a car for a day or two, and when you come back three years later the driver treats you like a long-lost friend, asking after your family, inquiring about how your career is going: He remembers everything, and he genuinely cares.

Peshawar's wild and colorful happenings go back a long, long time; the city's location, at the eastern approaches to the Khyber Pass, has given it a history that is endlessly hyperactive, relentlessly romantic. Alexander the Great battled his way through the area in 327 B.C., en route to India; in the centuries since, empire-builders ranging from Sikhs and Afghans to Huns, Mongols and Victorian Englishmen have fought and died here. Rudyard Kipling wrote some of his finest poems about this danger zone at the edge of the Empire: When spring-time flushes the des- ert grass, Our kafilas wind through the Khy- ber Pass ... As the snowbound trade of the North comes down To the market-square of Peshawur town. A scrimmage in a Border station -- A canter down some dark defile -- Two thousand pounds of education Drops to a ten-rupee jezail -- The Crammer's boast, the Squad- ron's pride, Shot like a rabbit in a ride!

Everywhere you look in contemporary Peshawar, you find evidence of this ancient, ongoing struggle, intrigue. On the way into the city from the east, driving the Grand Trunk Road from Rawalpindi and Islamabad, you leave the flat plains of the Indus River behind. The mountains of the Hindu Kush tower in the distance, the city a sprawl of turquoise minarets and adobe beneath.

You pass below the towering hulk of the Bala Hisar Fort, originally built by the Afghan conquistador Babur in the 1520s, on his way to conquer India and establish the Mogul Empire. The fort was rebuilt in the early 19th century by the Sikh governor of Peshawar, and today it serves as headquarters of Pakistan's Frontier Corps, helping guard the border with Soviet-occupied Afghanistan.

In the old bazaars of Qissa Khawani and Chowk Yaadgar, south of Bala Hisar in the Old City, you can buy brass medals and decorations from any number of 19th- and early 20th-century British military campaigns, ranging from South Waziristan, Afghanistan and the Boer War (a grumpy "Victoria Regina Et Imperiatrix" on one side, a svelte Goddess of Victory rallying the troops on the other) to the First World War and the Younghusband Expedition to Tibet. On a more modern note, you can also buy cassettes of patriotic music from the present-day struggle of the Afghan Mujaheddin against the Soviet Union -- one particularly stirring song features a rhythm section of AK-47 assault rifles, Kalashnikovs, fired on full automatic -- and posters and calendars of resistance heroes, posed against gaudy backgrounds of fiery rockets, exploding bombs and swarms of jets.

The gun is an omnipresent totem, icon, among the proud, touchy Pathans, and the guns go off all the time. According to one version of an incident last year, the Pakistan International Airlines flight from Islamabad to Peshawar was shot down, reportedly by a crowd of Pathans celebrating a wedding; they fired their Kalashnikovs and carbines into the air, just as the unlucky four-engined prop plane flew overhead, inadvertently knocking it out of the sky.

In another recent incident, a delegation of American officials went out into the Tribal Area south of Peshawar to cut the ribbon on a new section of road, resurfaced with the help of U.S. AID money. The local tribesmen liked the new road, liked it a lot, and to show their appreciation they began firing off rifles and AD-47s. As the festivities reached a higher pitch, someone opened up with one or more 12.7 mm antiaircraft guns; the Americans began to grow restive. When the happy Pathans began bombarding a nearby mountainside with long-range surface-to-surface missiles, the officials got in their cars and fled back to the safety of Peshawar.

It is important to remember the Pathans' Pushtunvalli code of conduct. Much of Peshawar's great charm as a city springs from the Pathans and their Weltanschauung. In his fine book "Afghanistan: Inside a Rebel Stronghold," British war correspondent Mike Martin describes how a group of Punjabi bullies ripped up a book he was reading in a Peshawar teahouse and refused to pay for it; several Pathans, "their faces wreathed in smiles beneath magnificent loose turbans," blocked the door, pulled knives and quietly forced the Punjabis to pay Martin the price of the book. "They are bad men. You are guest in Peshawar," one of the Pathans told Martin.

Such quasi-violent incidents are the very rare exception rather than the rule in Peshawar, but Pathan friendliness and hospitality, and honesty, are not.

It is a strange, archaic world, this Peshawar, part "Arabian Nights," part "Alexandria Quartet," part "Tales From the Raj." Dean's, the old colonial hotel on Shahrah-e-Pehlavi Road, was named after Colonial Gov. Harold Dean, who used to begin negotiations with Pathan chiefs by giving them fancy pairs of English dress shoes, very narrow. He then took the unsuspecting chiefs on long walks, negotiating as they went; the shoes caused such agonies that inevitably the chiefs gave in, just to keep from walking further. So the story goes, at any rate. Things have not really changed that much. It is not uncommon, staying at Dean's, to run into a mixed corps of Pakistani soldiers and fierce tribal bodyguards in the garden, there to guard some Pathan bigwig down from the mountains to negotiate with the Pakistani government.

The fantastical is never very far away, in Peshawar. The name means "City of Flowers," but it is really a City of Stories -- thousands upon thousands of them, piled up in layers, subterranean laminations, drifts of myth, veins of phosphorescent legend:

At the red brick University, a leftist professor tells a roomful of students that the Pakistani government can save itself from Soviet expansionism by renting the Russians a warm-water port on the coast of Bakuchistan.

An editorial in an obscure and maladroit newspaper accuses Israel of flooding Pakistan with counterfeit Korans, full of misprints and theological errors, to confuse and demoralize the Moslem Faithful.

An old, old Afghan refugee tells you how he fought the British on the Frontier back in the 1930s: "They never hurt women and children, and when the fighting was over they gave us nice presents, so we wouldn't attack them again."

In the Chowk Yaadgar, a money-changer keeps a phone in his safe with an open line to Zurich and Kabul; he can pick it up and in an instant know the global price of gold, the conversion rate of afghanis to U.S. dollars, Pakistani rupees, yen, deutsch marks.

An old German Mercedes tour bus passes on the Khyber Road; stranded in Pakistan by the Afghan War -- it used to do the Munich to Katmandu run, back in the '70s -- it now circulates between Peshawar and Landi Kotal, on the Khyber Pass, jammed full of turbaned warriors.

This pervasive attar of legend, fairy tale, is everywhere. Eat lunch at Lala's, the popular restaurant at the Green Hotel, and a gaggle of tribal chieftains at the next table, big men with henna-dyed beards and immaculate turbans, gawk at you like you are a Martian, mouths gaping, eyes staring. They have just come down from some valley beyond the edge of the 20th century, and you are the first European, non-Moslem they have ever seen. They stare and stare, and whisper amongst themselves, as they munch away at their kebabs and pilau. What strange, medieval worlds revolve behind those dark, curious, not unkind eyes? You feel like The Man Who Would Be King, until Lala's music system begins playing Madonna, singing "Like a Virgin" -- so incongruous, in this sternly Islamic city, that for a moment you wonder who, where, when you are. Just another typical moment in Peshawar.

In the Shahrah-e-Pehlavi Road bazaar, a carpet merchant shows you a rug just brought down by caravan from Badakshan, in the far north of Afghanistan. Its central patterns are traditional, semiabstract, but around the border is an endless convoy of Soviet tanks, simplified but unmistakable. The weavers, simple tribal people, put the most dramatic objects they can find into their work: Other carpets show MI-24 helicopter gunships, stylized guerrillas, armored cars. Perhaps it is a way of making sense out of the incomprehensible, by weaving it in with patterns that are ancient, native, familiar. Here in Peshawar, it makes perfect sense.

At night, driving out toward the Khyber Pass, through the outskirts of the city, you see tracers, distant golden arcs of gunfire, looping across the dark hills. "Don't worry," your Pathan friend says. "No fighting. It is wedding. They are shooting because they are happy."

Rob Schultheis is covering the war in Afghanistan for Time magazine.