Here in Pakistan’s Swat Valley, known for gorgeous sunsets and the calming sound of river rapids, there has been plenty of misery over the past decade.

First, Pakistani Taliban militants swept into this conservative part of northwestern Pakistan, killing more than 2,000 people. Then Pakistan’s army showed up to battle the Taliban, forcing 1.5 million residents to flee their homes. And even after soldiers regained control and residents returned, the 2012 shooting of schoolgirl Malala Yousafzai was a reminder that life here remained cruel and unpredictable.

But now, with security finally improving, residents are releasing years of stress by flocking to new shopping and entertainment outlets whose existence would have been unthinkable when the Taliban was executing men for shaving or women for dancing.

“Before, we were very scared of them. Our education system was totally down, because when you would go to school, every morning there would be a man lying with his head cut, thrown by the Taliban on the road,” said Arsalan Khan, 25, a resident of this midsize city. “Now, we can just focus on how to live normally.”

Though the residents of Swat have long been more educated and wealthier than those in many other rural areas of Pakistan, the changing lifestyles here offer a glimpse into how quickly an area can start modernizing when fears of Islamist militants fade.

Abdullah, 20, waits for customers at the Minnie Minors outlet on April 25 at a market in Swat Valley. (Mian Khursheed/For The Washington Post)

Even before the Taliban gained effective control over this area in 2007, the mountains that tower over this agricultural region served as a barrier to technology and social changes. But residents say that isolation is quickly being replaced with demand for new haircuts, music, movies and fashion styles.

“We now want to dress like the people of Punjab,” said Abid Ibrahim, 19, referring to the eastern province that includes Lahore, often referred to as Pakistan’s most progressive city. “We want to make ourselves look like models, and with the hairstyles from magazines like developed people.”

Ibrahim was at an amusement and gaming center called Motion Rider, which opened in Mingora in February. Life-size posters of a soldier in U.S. military combat gear and European soccer stars Lionel Messi and Cristiano Ronaldo hang on the walls, and customers play Xbox games on big-screen televisions.

The main attraction is a 3-D movie theater where seats move in sync with the action on the screen. On a recent visit, patrons were watching “Into the Forest” — a psychedelic ride in which viewers dodge neon trees, bees, butterflies and giant mushrooms.

“Everyone had been very depressed, but now people just want to have fun,” said Syad Imad, 36, who owns Motion Rider.

Several new Pakistani clothing chains from major cities have also opened in the past year. One store sells women’s jeans, even though most women in Swat wear a burqa or cover their faces with a headscarf when they appear in public.

Still, residents say the mere presence of women out shopping, unescorted by male relatives, is a sign of progress.

Abrar Ali, 20, adjusts clothing on display at the Chen One outlet at a Swat Valley market. (Mian Khursheed/For The Washington Post)

“I am very optimistic about the future of Swat,” said Iffat Nasir, an activist and school principal, who added that female enrollment in school is increasing steadily. “I see Swat becoming a very modern place.”

Some analysts are less certain, noting the area still lags in expanding rights for women, tempering the influence of Islamic schools, known as madrassas, and reinvigorating tourism. And they say advances in Mingora and other population centers are not reflective of far-flung areas in the 3,300-square-mile valley, home to about 2 million people.

“It’s still not back to what it was pre-Taliban times,” said Zebunnisa Jilani, who founded the Swat Relief Initiative, a local aid group. But, she added, “I’ve been to a lot of Pakistan, and I now think Swat is one of the safest places.”

Tucked in the Hindu Kush and Karakoram mountain ranges, Swat has been referred to as the “Switzerland of Asia” because of its alpine forests and chilly streams.

Even after Pakistan was partitioned from India in 1947, Swat remained a semiautonomous state and was governed by a royal family for another two decades. At that time, the valley was known as a moderate, tolerant area with good schools and roads and an efficient justice system.

But after Swat was incorporated into Khyber Pakhtunkhwa province in 1969, it, like many other areas of Pakistan, began feeling the pull of Islamic fundamentalism.

In the early 2000s, as a majority of Pakistani voters began supporting conservative Islamist political parties, a young radical named Maulana Fazlullah began using radio broadcasts to organize in the area. He aligned with the Pakistani Taliban in 2007.

Over the next two years, the Taliban gained effective control of much of Swat. It banned dancing, parties and music shops, and warned barbers not to shave beards. Residents who disobeyed were often executed, including one woman who was hanged in Mingora for dancing. The Taliban also destroyed more than 400 schools.

In 2009, amid growing concern that the Taliban could sweep into the capital, Islamabad, a four-hour drive from Swat, the Pakistani army ordered residents to leave so it could fight the militants. Most were allowed to return home three months later, but the army kept tight control over movements in the area for years.

But the shooting of Yousafzai, who was 15 at the time, showed the dangers that remained despite the military presence. Yousafzai, who had publicly urged girls to return to school, survived and now lives in Britain. Fazlullah is now the top leader of the Pakistani Taliban, though he is believed to live in Afghanistan.

There have been about 50 murders in Swat over the past four years, according to Inamur Rehman, chief of the Swat peace committee. He said most attacks are directed at politicians or law enforcement officials. There hasn’t been a major bombing in the valley in about three years, Rehman said.

As violence has lessened, cultural shifts have become easier to spot. The traditional loose-fitting tunics and pants worn by men — called shalwar kameez — are getting more colorful. More women are wearing pants under knee-high dresses, according to local retailers.

Al-Khaleej Barbershop, located about a mile from where Yousafzai was shot, now uses Western models for its window advertisements.

“Fewer and fewer here are keeping beards,” said college student Hazrat Bilal, 20, who waited an hour for a spiky haircut on a recent Saturday morning. “For haircuts, mostly we are taking inspiration from [soccer star] Ronaldo and Justin Bieber.”

At a video store nearby, employee Khan Muhammad said more than 40 video and music stores had been forced to close or sell only religious-themed movies when the Taliban was in control. Now, he said, the American “Fast & Furious” movie series starring Vin Diesel is the top-seller.

In the evenings, Mingora residents once again flock to the banks of the Swat River to watch the sunset. As they gaze across, they see Fazlullah’s home town, Mam Dheri, on the opposite shore.

“Some people still feel the past trauma,” said taxi driver Hussain Ali, 32, as a cable car traversed the river, carrying passengers between the two cities. “But slowly but surely, they are coming out of fear.”

Haq Nawaz Khan contributed to this report.

Read more:

Mullah Radio: The radical broadcaster leading the Taliban’s war on Pakistani children

In Pakistan’s Swat Valley, Malala’s peace prize seen as slap at Taliban

Taliban says it shot Pakistani teen for advocating girls’ rights