Indus Maps

Indus Maps › Legends and folklore › Raja Gira's Castle

Raja Gira's Castle

Hero or king · Raja Gira's Castle above Udegram, Swat, Khyber Pakhtunkhwa

See it on the map ›
Ink and watercolor: the ruined stone walls of a castle and a great sloping-walled bastion along a rocky ridge above the green Swat valley and its river, with snowy peaks beyond; lower down, a small ruined tower beside a spring spilling among boulders, and the low roofless walls and column bases of an old mosque on a terrace, with a shepherd seen from behind walking four goats along the path beside it.
Illustration made with AI (ChatGPT) from a brief based on the sources below.

Note for younger readers: A siege and a battle in which the hero dies; the story is about a conquest, told from the conquerors' side.

Above the village of Udegram in lower Swat, a ridge of bare rock climbs nearly two thousand feet, and along its crest run the broken walls of a fortress. The people of Udegram call it Raja Gira's Castle, after the last king who held Swat before Islam came.

The story says the king's stronghold could not be taken by storm. Its walls ran along a knife-edged crest with sheer cliffs on one side, and a massive buttressed bastion guarded the easiest way up. When the armies of Mahmud of Ghazni came up the valley, they camped below and laid siege. Tellers do not agree on how long it lasted: one old account says the siege dragged on for years.

What finally decided it, according to a version printed in 2016, was water: the fort drew its water from the Swat River below, and when that supply was cut, the defenders could not hold out. (The ruins themselves have a spring inside the walls.) The fortress fell. A local guide's version adds that Raja Gira escaped and fled north into Kohistan. The Torwali, Gawri and Kohistani people of the upper valleys, who call him their own last king, have their own endings. The Kohistani historian Gumnam Kohistani says he fled toward the upper Panjkora and died on the way; Dr Bilal of the Gawri community says he fell fighting at Barikot and Udegram. Both say his son, Raja Bira, then led their people on toward Dir.

The leader of the Muslim fighters, remembered as Pir Khushhal Baba and locally as Ghazi Baba, was killed in the fighting, and he lies buried where the valley opens out towards the village. His shrine stands among old graveyards and sacred groves; when Aurel Stein came in 1926, the ground around it was not ploughed or even planted with fruit trees, out of respect.

Below the castle, on a terrace of the same hill, archaeologists later uncovered the stone walls of a mosque. A marble slab found there says it was founded in the year 1048-49 by order of a Ghaznavid commander, and the Italian archaeologists who excavated it count it the oldest mosque known in northern Pakistan.

How it is told

The story is kept at Pir Khushhal Baba's shrine and by guides at Udegram, and as their own history by the Torwali, Gawri and Kohistani people; the Torwali writer Zubair Torwali told TNN in 2026, "We Torwalis also consider Raja Gira our last king." The same report mentions a daughter, Manja Devi, and tales of her and Pir Khushhal, which I could not find in full. The oldest written record I found is Aurel Stein's, from his tour of March-May 1926. He surveyed the ridge, noted that a single spring inside the walls was the only water within the defences and was specially guarded, and wrote down the 'pious tradition' that Pir Khushhal Baba led the faithful in Mahmud's army and took the fortress from the last king of Swat after a siege 'protracted for years'. Stein himself thought the stronghold far older and suggested it was Ora, a town Alexander took on his march through Swat. The cut-water ending is from the Express Tribune (2016), and Raja Gira's flight to Kohistan from a guide quoted in Dawn (2014); other online versions add details (salted horses, a supply line from Manglawar) that I could not trace to any source I was able to open, so they are left out. The archaeology is separate. An Arabic inscription on black marble found by chance in 1984 below the castle records the founding of a mosque in AH 440 (1048-49 CE) by order of a Ghaznavid amir, Nushtegin, known only from this inscription. The Italian Archaeological Mission then excavated the mosque and the settlement around it (1985-1999), and the Mission's own history calls it the oldest mosque in northern Pakistan and the third oldest in the country. Italian excavation later showed that the castle's own upper levels were a fortified Ghaznavid-period settlement (Dawn 2017), although Stein in 1926 had found no surface pottery of the years just before the conquest. Iranica counts the Udegram slab among probably the earliest monumental inscriptions in cursive Arabic script anywhere. Olivieri, quoted in Dawn (2016), dates Udegram's role as Swat's capital to the Hindu Shahi period, 8th-10th century, and Dawn reports the castle's main occupation as 7th-10th century, but the Department of Archaeology's site record gives 4th-2nd century BCE. The residential quarter round the mosque was deserted by the end of the 12th century.

Written down by outsiders

Parts of this story reach us through people from outside the community that tells it. Here is who they were, and what may colour their accounts.

At a glance

Tradition
Told at Udegram, Swat, around the ziarat of Pir Khushhal Baba, and by the Torwali, Gawri and Kohistani people who count Raja Gira as their own last king
Era
Set in the 11th century, at the coming of the Ghaznavid armies; recorded by Stein in 1926 and still told by guides
Place
Raja Gira's Castle above Udegram, Swat, Khyber Pakhtunkhwa

Sources