Saudi Arabia's prosecutor says 17 people have been detained on suspicion of trying to undermine security and stability, a case activists say has targeted prominent women's rights campaigners just weeks before the country lifts its ban on women driving.

The statement from the Public Prosecutor's office on Sunday did not name those detained, and said eight have been temporarily released. It says five men and four women are still being held with "sufficient evidence against them, as well as their confession to the charges."

The statement says the accused admitted to communicating with people and organizations hostile to the kingdom, recruiting people in a sensitive government entity to obtain confidential information, and providing financial support to hostile elements abroad.

Rights groups have condemned the arrests.