An explosion shatters the peace of the village of Dassu, on the banks of the river Braldo, deep in the mountains of the Pakistani Karakoram. A mile upstream, suspended 260ft above the ground, Mohammad Ashraf puts another explosive in place and lights the fuse before taking cover.

The explosion shakes the valley and spews a hail of stones into the void. Ashraf and his partner Gulam Nassur, armed with mallets and chisels, set to work while poised over the abyss. They're searching for gems, turned into crystals at great depth by tectonic phenomena in what are known as "pegmatite" seams. Here, on the doorstep of a national park, Ashraf and Gulam handle large amounts of illegal explosives, working on a sheer cliff face while loaded with heavy pneumatic drills. In these mountains, however, as in many other parts of Pakistan, survival comes first, and obedience to the law second.

The story of Gulam and Ashraf is the story of a country always on the brink of tragedy which has learnt that often the best way to get by is through laughter. Should they find a nice aquamarine, ruby or emerald, they will be rich; if not, they will go on working from sunrise to sundown, struggling on in poverty.

Download the new Independent Premium app Sharing the full story, not just the headlines

Skardu, the capital of Baltistan, is a dusty town in the north of the country. Both sides of the only road that crosses these mountains are packed with bazaars. Behind the shops, single-storey dwellings huddle up amid a chaos of wires, irrigation channels and unpaved streets. The administrative district of Gilgit-Baltistan is one of several areas of Kashmir controlled by Pakistan. According to the Institute for Gilgit-Baltistan Studies, more than half of the population here live below the poverty line. The sale of gems, supplied by about 3,800 miners who work the surrounding valleys, takes place mostly in Skardu.

Rozi Ali is a bepari, a gemstone and mineral dealer. Now 35, he drives the latest 4x4 and lives in a two-storey building whose fancy columns bear witness to his status. Like the majority of Baltistan's population, he is a Shiite, and proudly displays a picture of a religious pilgrimage to Iran in his living-room. His youngest son produces packages of stones wrapped in newspaper. In the blink of an eye, the narrow hallway is filled with hundreds of aquamarines, topazes, epidotes, emeralds, tourmalines, garnets and rubies. These are uncut stones, some of great quality. Ali sells the largest to foreign museums. The smallest go to Peshawar, Karachi, India or Thailand, where they are cut and certified, often with no questions asked about their origin.

The village of Hushe is located more than 10,000ft above sea level, in the heart of the Karakoram mountains, not too far from the Chinese border and the Siachen glacier, a disputed zone now occupied by the Indian army. This remote area is home to four of only 14 mountains in the world to top 26,247ft (8,000m). K2, the planet's second highest peak at 28,250ft and perhaps the most difficult and dangerous k of all to climb, is the best known. One in every nine people who reach the top of K2 dies during the descent. In 2008, 11 people were killed by an avalanche at 27,230ft. At that altitude, even breathing is an extreme exertion.

Over the past 30 years, due to the increasing popularity of mountain tourism, the strongest men in Hushe have worked as high-altitude porters. These are the men who carry the equipment, set the ropes and take the lead; they are also those who carry the oxygen bottles, tidy up the camp when it's all over and, above all, those who die. During the short and risky season they may earn about £1,250 for a five-week expedition. The alternatives, for those who lack the strength or prefer to avoid disproportionate risk, are shepherding and mining.

Gulam Nabi looks frail, but if you peer deep into his eyes you may catch of a glimpse of the cheerful and indifferent disposition of a man who has escaped death many times. His hands also tell a story that seemingly has little to do with his slight build and shy appearance. All his fingers are intact, an unusual feature among men who spend their lives handling explosives or carrying loads at 26,000ft at temperatures of 20 degrees below freezing. Nabi, who is 32, explains that he's always taken good care of himself up in the mountains. "When I'm above 23,000ft, I never take off my goose-feather gloves," he says. "Uncovering your hand for a moment would be enough for it to freeze."

Nabi is from Hushe, and has spent the past eight years working as a high-altitude porter. This year, however, he decided to take some time off during the summer season to try his luck at mining. In the mountains of Pakistan, summer is short: about two months during which the climate is benign enough to work at high altitude. Nabi's mine is two days' walk from Hushe, on the right side of the Gondogoro glacier, and surrounded by mountains above 20,000ft. The miners work in a team of eight or nine called a handual. Two or three of them will be investors. One buys the explosives; another purchases the pneumatic drill; a third takes care of food expenses. The rest are unskilled labourers. Investors don't work, but the profits are divided equally among all members of the handual.

Nabi's case is exceptional, as he has decided to work on his own, with only his wife for company. The mine, located inside the Karakoram National Park, belongs to the Pakistani people, but he doesn't have a permit to work there. For several days he carries 80lb loads to the campsite, a tough job but one he's used to as a result of his work as a porter. From the meadow of Shakg La, at 14,110ft, he searches for a vein of pegmatite to work on. The chosen spot is awe-inspiring.

On the vertical face of the Mancila peak, a ravine traverses a drop of more than 3,000ft, the first 650ft of which are as smooth as a mirror, as a result of avalanches. There, at the most dangerous spot on the mountain, is where Nabi has set up his work station. "I spent several days looking at the wall through binoculars until I located a cavity in a vein. There are more chances of finding gems in places where the rock is softer," he says as his wife heats tea. "I carried the drill up using a system of pulleys and began chipping away to make a hole so I could protect myself and avoid being struck by falling stones. None the less, I've lost several ropes to avalanches." Sitting on the floor, he admits: "This first year I've had no luck; all I found was a few worthless crystals."

The Antiterrorism Office of the US State Department reports that more than 3,170 people died in Pakistan in 2011 as a result of terrorist incidents. The same report also warns that attacks have increased by 8 per cent. In a country where explosives are cheap and easy to come by, there are many opportunities to blow things up. Muhammad Isaac holds an explosive cartridge in his hands while explaining the process his handual used to purchase the 88lbs of explosives they expended in the Hushe mine this summer. Isaac works on the same wall as Nabi; he simply does so several hundred yards above him. "You need a licence in order to purchase these cartridges. In Skardu there are two places where you can buy them for 150 rupees [£1] each." While speaking he shifts the cartridge from hand to hand as if it were a toy. This compound, made of TNT, nitro-glycerine and DNT, is a nightmare for the Allied forces in Afghanistan.

Years ago, tourism was one of Baltistan's main industries, but following 9/11 the number of foreigners visiting the region dwindled drastically. The entire population of Dassu is Shiite, and homes are decorated with posters of Ayatollah Khomeini. According to the US State Department, the number of Shiites killed at the hands of Sunni extremists has increased for the third year in a row now. In Pakistan, both Shiite and Sunni mosques are regularly blown up using the explosives that are so readily available.

One might say that the makeshift, dangerous and unregulated industry of the Baltistan mines is a reflection of a country torn apart by wars and civil strife. According to one observer, Haroon Arbab, who worked for the Stone and Mining Department, Baltistan's illegal miners can only be understood in this context. In the final analysis, he reflects, "These men aren't miners, they're survivors."