They were arrested, suspended from jobs, shunned by relatives and denounced by clerics as loose women out to destroy society. Their offence? They did what many in Saudi Arabia considered unthinkable: getting into cars and driving.

Their protest in 1990 against the kingdom’s ban on women driving failed, and the women paid dearly for it, with the stigma of being “drivers” clinging to them for years.

So last month, when King Salman announced that the ban on women driving would be lifted next June, few were happier than the first women to demonstrate for that right – almost three decades ago.

“I’d thought maybe I’d die before I saw it,” says Nourah Alghanem, who had helped plan the protest. Now she’s 61 and retired with five grandchildren. “What’s important is that our kingdom entered the 21st century... finally!”

The backlash against the 47 women who protested illustrates how deeply the driving ban was embedded in Saudi Arabia’s conservative society, reinforced by the state and its religious apparatus.

But since then, globalisation, social media, economic pressures and leadership changes finally created the conditions for the ban to end.

These are dizzying days in Saudi Arabia.

Carmakers are now targeting advertisements toward Saudi women, and a women’s university is planning a driving school.

And the changes are not only related to the prospect of so many new drivers on the kingdom’s highways. At a public celebration last month, crowds of men and women danced together as a DJ played. An end to the ban on cinemas is expected soon.

But in 1990, when the four dozen women took an extraordinary risk by fighting the driving ban, conditions in the kingdom were notably different.

At the time of the protest, Alghanem was 34-year-old graduate, with a husband, four children and a job at a school.

“I didn’t have anything interesting in my life,” she recalls.

At the time, Saudi women were severely restricted. The culture was highly patriarchal, and clerics, thanks to their alliance with the royal family, had tremendous power to defend the kingdom against what they considered to be corrupting influences.

Women still remain under strict guardianship laws in Saudi Arabia

Much of that meant controlling women, and they saw the driving ban as necessary to prevent adultery and other social ills.

“Allowing women to drive contributes to the downfall of the society,” the kingdom’s top cleric at the time wrote in a fatwa that was removed recently from a government website. “This is well known.”

Women who detested the ban saw an opportunity when Saddam Hussein invaded Kuwait in 1990. US forces flooded the kingdom, including US servicewomen who drove military vehicles. Kuwaiti women who had fled the invasion also drove.

Alghanem took note.

“I saw that we as Saudi women were powerless,” she says.

She invited other women to her home to discuss the issue, and they decided to take action. They sent a letter to Salman – at the time the governor of Riyadh province – telling him that they planned to drive.

They never heard back, they say, so on 6 November 1990, they met near a supermarket in Riyadh, piled into 14 cars piloted by women with valid foreign licenses and drove around town.

They were social outliers, backed by no political party, and other Saudi women did not rush to join them. Many came from affluent families and had studied abroad. They included teachers, professors, a social worker, a photographer and a dentist.

Most were married with children; at least two were pregnant. One woman joined late, with her two daughters, one of whom was breast-feeding. Some had defied their male relatives to show up. Supportive husbands and brothers dropped off others at the meeting place.

Word spread, and the women were stopped by both the traffic police and the religious police, some of whom furiously banged on the cars.

“I want to dig a hole to bury you all!” Fawziah al-Bakr, an education professor, recalls one man shouting at her. “They were thinking that we were going to destroy this country.”

They were taken to the police station and released around dawn, after they and their male relatives signed pledges that the women would not drive again.

The next morning, Asma Alaboudi, a school social worker who had participated, overheard her colleagues saying that the women at the protest had burnt their clothes, worn bikinis and danced in the streets – all grave acts that had not happened.

Soon, the women’s names were distributed, inflaming public anger.

King Fahd issued a decree suspending those who had government jobs, and preachers excoriated them during Friday prayers.

“At that point, the society revolted,” Bakr recalls.

Monera Alnahedh, who later became an international-development worker, says her father quit praying at his local mosque after the preacher said the women had been inseminated by 10 men.

Officials from the interior ministry came to the home of Madeha Alajroush, a photographer, to confiscate and destroy all her negatives – 15 years of work.

“That was a way of punishing me,” she says.

Some friends and relatives shunned the women.

Carmakers are now targeting adverts at women in the country

“It was a very, very scary environment,” Alajroush says.

The harsh response from the state and society buried the issue of women driving.

“It was a very heavy blow on the women who drove, and it was perceived by the society as a very heavy blow,” says Alnahedh, the development worker. “There was a decade of silence.”

The suspended women struggled to find work, with some choosing to pursue advanced degrees.

About two years later, a princess intervened with the king, who returned them to their jobs and paid some of their lost wages.

Many of the 47 faded into private life, while others looked for ways to help women at girls’ schools, women’s universities and in programmes for abused women and children.

Slowly, society changed.

University enrolment for both women and men rose, and in 2005, King Abdullah created a scholarship programme that sent hundreds of thousands of young Saudis, including many women, abroad, broadening their perspectives.

He added women to the Shura Council, an advisory body, and social media spread among the kingdom’s youth, giving them freedom online that they lacked in real life.

The internet eroded the monopoly Saudi clerics had on religious interpretation, and many Saudis realised how differently Islam was practiced in other countries.

The government allowed women to work in new jobs, making their daily commute an issue.

Younger activists started to revive the struggle to let women drive.

In 2011, Manal al-Sharif posted a video online of herself driving and was detained. In 2013, dozens of Saudi women drove to protest against the ban.

In 2014, Loujain Hathloul tried to cross the border from the United Arab Emirates into Saudi Arabia in her car and was jailed for 73 days.

Few of the women who had driven in 1990 joined the new protests, but they cheered the younger women.

“We were very angry,” Alajroush, the photographer, says of Hathloul’s detention. “But inside of me, I thought that was a big step forward because finally we were taken seriously.”

In 2015, Salman became king, and he empowered his young son, Mohammed bin Salman, who is now crown prince.

As the price of oil sank, sapping the economy, the crown prince laid out a sweeping plan to reform the economy, including increasing women’s participation in the workforce.

Other steps followed. Women voted and ran for seats on local councils in 2015 for the first time, and some won. Public schools were told to offer physical education for girls, which clerics had argued threatened their femininity.

Then late last month, Alghanem, who had held the first meeting on the driving ban in 1990, was playing cards when her phone suddenly began overflowing with messages, she says.

Her husband called, shouting, “Congratulations!” and told her the ban was being lifted.

Alghanem – who had merely ridden along in 1990 and still cannot drive – plans to learn. “I must get a license and drive,” she says.

The government has played down any role the female activists played in prompting the decision, and some of the women say security officials have told them in phone calls to keep quiet.

The information ministry denied such calls were being made.

Many Saudis argue that the women exacerbated the issue by provoking the conservatives. In the kingdom, they argue, rights are given by the ruler, not publicly demanded by the people.

“It is natural that they are happy that they have been given their legal right that they had demanded before,” Prince Abdulrahman bin Musaid wrote on Twitter. But he called the idea that the women’s “struggle” had influenced the decision “a great fantasy”.

The women believe the government will not acknowledge them so as not to encourage other activists.

Many restrictions on women remain, including guardianship laws that give Saudi men power over their female relatives on certain matters. But the original protesters are overjoyed that their daughters and granddaughters will have freer lives than they did, thanks to the car.

“That I am driving means that I know where I am going, when I’m coming back and what I’m doing,” says Alaboudi, the social worker.

“It is not just driving a car,” she says, “it is driving a life.”