Saudi Arabia has detained several prominent female activists who campaigned for women’s right to drive, taking them into custody just weeks before the decades-long driving ban finally comes to an end.

Human rights groups said Loujain al-Hathloul, Eman al-Nafjan and Aziza al-Yousef - three of the most prominent voices demanding women be free to drive - were all detained on Thursday. Two male advocates for women’s rights were also detained, activists said.

The activists were detained as Saudi Arabia prepares for the driving ban to come to an end on June 24. The policy shift has become a symbol of the modernising drive of Crown Prince Mohammed bin Salman, and the Saudi government is eager for positive media coverage of the move.

The detentions appear to be an effort by Saudi authorities to make sure they do not have to share credit for the end of the driving ban with activists who spent years campaigning for it.

They may also be concerned that the women right’s campaigners would use the end of the driving to call for further advances in women’s freedom - like an end to the male guardianship system that severely limits Saudi women’s ability to travel independently.