Spring in Pakistan’s capital brings explosions of pink bougainvillea and the subtle scent of roses. There’s another unmistakable aroma wafting in the air, too, thanks to the abundance of a widespread plant: marijuana.

The weed grows wild throughout Islamabad, noticeable along roadsides and in parks and vacant lots, where fields are already waist-high, thanks to recent rains and climbing heat. Here, the uncultivated plant is of little interest or value to residents. But cannabis is an important cash crop in the northwestern, mountainous regions of Pakistan, the center of hashish production.

Today, though, pot farmers and hashish producers there are facing hard times and considerable danger. The Pakistani Taliban and allied extremists have largely taken control of the hashish-rich Tirah Valley in the Khyber tribal agency, pushing out residents and taking over their crops and production of the smokable drug.

In a recent armed clash, militants attacked a pro-government tribal militia and occupied the valley. The Pakistani army has launched an offensive against the insurgents in a struggle that has claimed scores of lives on both sides.

The conflict also has spurred a migration of nearly 50,000 people to the nearest big city, Peshawar, the capital of Khyber Pakhtunkhwa province, and surrounding areas. Officials say that the number of those displaced is likely to grow and that there is little chance that any of the refugees will see their homes again soon.

During the 1960s and ’70s, Peshawar was a far more mellow place. It was an obligatory stop along what was called “the hippie trail,” which drew American and European wanderers to Pakistan, Afghanistan, India, Nepal and other exotic locales in search of groovy times and good hash.

“Numerous low-budget hotels and a thriving tourist industry sprang up [in Peshawar, Lahore and Karachi] to accommodate these travelers,” wrote Dawn newspaper blogger Nadeem F. Paracha, who chronicled some of the secular features of Pakistan’s past in a series last year called “Also Pakistan.”

He included a grainy black-and-white photo of “real hippies enjoying a few puffs of hashish on the roof of a cheap hotel in Peshawar in 1972.”

Consumption of hashish is prohibited by law in Pakistan, but in Khyber and other tribal areas, the law is lightly enforced, if at all. Elsewhere in Pakistan, the use of hashish is widely tolerated. The marijuana plant also is boiled with water, almonds and milk to make bhang, a popular drink often served cool during the warm months.

The hash markets in and around Peshawar still thrive, and smoking the pungent product, called “garda,” remains popular.

Hashish is produced by compressing the resin-rich flowers of the cannabis plant and maturing the resulting tacky substance in goatskins. Farmers say some of the best hashish comes from the Tirah Valley, where tribesmen process it in their homes — or used to.

Displaced residents say the extremists seized their goods to use as a source of funding for their insurgency against the Pakistani state.

“The stock of hashish is in the control of the occupants of the valley,” said a displaced tribesman, Shah Jehan, 42, without mentioning the names of the militant groups that are thought to control the valley, Tehrik-e-Taliban Pakistan and Lashkar-e-Islam.

Some tribesmen expect the price of hashish to increase because most farmers missed the growing season that began last month as the extremists pushed them out.

“There is a projection that the prices will go up next year, as the people did not grow the marijuana crop,” said Jehan, now settled in Peshawar. “It will have its impact on the market in the months ahead.”

“Marijuana, and its product, hashish, is the main source of income of our people,” said Zaman Afridi, 34, a refugee in the United Nations-run Jalozai camp not far from Peshawar.

“We missed the marijuana growing season in March, and only 5 to 6 percent of people might have cultivated the crop,” Afridi said.

Because of the insurgency, the price of hashish has gone up several times, he said. Top-grade hashish was sold for between $200 and $250 a kilogram before 2009, when major Pakistani army offensives began in Khyber agency. But now the price has doubled, he said.

And, Afridi predicted, “This large-scale migration will have negative effects on the hashish prices in the near future.”

Haq Nawaz Khan in Peshawar contributed to this story.