DUBAI, United Arab Emirates — Saudi Arabia issued its first driver’s licenses to 10 women Monday as the kingdom prepared to lift the world’s only ban on women driving in three weeks, but some who campaigned for the right to drive remain under arrest.

A government statement said the 10 women who were issued licenses already held driving licenses from other countries, including the U.S., U.K., Lebanon and Canada. They took a brief driving test and eye exam before being issued the licenses at the General Department of Traffic in the capital, Riyadh.

Other women across the country have been preparing for the right to drive on June 24 by taking driving courses on female-only college campuses. Some are even training to become drivers for ride hailing companies like Uber.

Saudi women had long complained of having to hire costly male drivers, use taxis or rely on male relatives to get to work and run errands.

The surprise move to issue some women licenses early came as activists who had campaigned for the right to drive remain under arrest, facing possible trial.

Saudi Arabia’s prosecutor said Sunday that 17 people had been detained in recent weeks on suspicion of trying to undermine security and stability, a case activists said targeted prominent women’s rights campaigners.

The prosecutor’s statement said eight have been temporarily released, while five men and four women remain under arrest.

Among the women held since May 15 are Loujain al-Hathloul, Aziza al-Yousef and Eman al-Nafjan, according to people with knowledge of the arrests who spoke on condition of anonymity for fear of repercussions.

The three are among the most outspoken and well-known women’s rights activists in Saudi Arabia. They not only risked arrest by pushing for the right to drive for years, but also called for an end to guardianship laws that give male relatives final say over a woman marrying or traveling abroad.

Their activism was seen as part of a larger democratic and civil rights push in the kingdom.