DUBAI, United Arab Emirates -- Just weeks before Saudi Arabia is set to lift its ban on women driving, the kingdom's state security said Saturday it had detained seven people who are being accused of working with "foreign entities." Rights activists say all those detained had worked in some capacity on women's rights issues, with five of those detained among the most prominent and outspoken women's rights campaigners in the country.

Pro-government media outlets have splashed their photos online and in newspapers, accusing them of betrayal and of being traitors.

The women activists had persistently called for the right to drive, but stressed that this was only the first step toward full rights. For years, they also called for an end to less visible forms of discrimination, such as lifting guardianship laws that give male relatives final say on whether a woman can travel abroad, obtain a passport or marry.

Get Breaking News Delivered to Your Inbox

Their movement was seen as part of a larger democratic and civil rights push in the kingdom, which remains an absolute monarchy where protests are illegal and where all major decision-making rests with the king and his son, Crown Prince Mohammed bin Salman.

Some state-linked media outlets published the names of those detained, which include Loujain al-Hathloul, Aziza al-Yousef and Eman al-Najfan.

Rights activists who spoke to The Associated Press on condition of anonymity for fear of repercussion say Madeha al-Ajroush and Aisha al-Manae are also among the seven detained. Both took part in the first women's protest movement for the right to drive in 1990, in which 50 women were arrested for driving and lost their passports and their jobs.

All five women are well-known activists who agitated for greater women's rights. Several of the women were professors at state-run universities and are mothers or grandmothers.

The Interior Ministry on Saturday did not name those arrested, but said the group is being investigated for communicating with "foreign entities," working to recruit people in sensitive government positions and providing money to foreign circles with the aim of destabilizing and harming the kingdom.

The stunning arrests come just six weeks before Saudi Arabia is set to lift the world's only ban on women driving next month.

When the kingdom issued its royal decree last year announcing that women would be allowed to drive in 2018, women's rights activists were contacted by the royal court and warned against giving interviews to the media or speaking out on social media.

Following the warnings, some women left the country for a period of time and others stopped voicing their opinions on Twitter.

As activists were pressured into silence, Saudi Arabia's 32-year-old heir to the throne stepped forth, positioning himself as the force behind the kingdom's reforms.

Human Rights Watch says, however, the crown prince's so-called reform campaign "has been a frenzy of fear for genuine Saudi reformers who dare to advocate publicly for human rights or women's empowerment."

"The message is clear that anyone expressing skepticism about the crown prince's rights agenda faces time in jail," said Sarah Leah Whitson, Middle East director at Human Rights Watch.

Last year, Prince Mohammed oversaw the arrests of dozens of writers, intellectuals and moderate clerics who were perceived as critics of his foreign policies. He also led an unprecedented shakedown of top princes and businessmen, forcing them to hand over significant portions of their wealth in exchange for their freedom as part of a purported anti-corruption campaign.

In an interview with "60 Minutes" in March, he said that he was "absolutely" sending a message through these arrests that there was a new sheriff in town.

Activists say writer Mohammed al-Rabea and lawyer Ibrahim al-Mudaimigh, two men who worked to support women's rights campaigners, are also among the seven detained. Al-Mudaimigh defended al-Hathloul in court when she was arrested in late 2014 for more than 70 days for her online criticism of the government and for attempting to bring attention to the driving ban by driving from neighboring United Arab Emirates into Saudi Arabia.

Those familiar with the arrests say al-Hathloul was forcibly taken by security forces earlier this year from the UAE, where she was residing, and forced back to the kingdom.

In recent weeks, activists say several women's rights campaigners were also banned from traveling abroad.

Immediately after news of the arrests broke, pro-government Twitter accounts were branding the group as treasonous under an Arabic hashtag describing them as traitors for foreign embassies.

The pro-government SaudiNews50 Twitter account, with its 11.5 million followers, splashed images of those arrested with red stamps over their face that read "traitor" and saying that "history spits in the face of the country's traitors."

The state-linked Al-Jazirah newspaper published on its front-page a photo of al-Hathloul and al-Yousef under a headline describing them as citizens who betrayed the nation.

Activists told the AP that some in the group were arrested on Tuesday and at least one person was arrested Thursday. They say the detainees were transferred from the capital, Riyadh, to the city of Jiddah for interrogations where the royal court has relocated for the month of Ramadan.

Activists say it's not clear why the seven have been arrested now.