BEIRUT, Lebanon — The office of Saudi Arabia’s public prosecutor said late Friday that it had completed its investigation into a group of women’s rights activists, accused of working to “undermine the security” of the kingdom, and was preparing to put them on trial.

Human rights groups have criticized the treatment of the activists, who were arrested last spring but have yet to face formal charges. Some of the activists were subjected to torture during interrogation, according to relatives and others briefed on their cases. Saudi Arabia denies that any were mistreated.

The group includes both women and men. Some had campaigned openly for Saudi Arabia to lift its ban on women driving, while others had supported the cause in quieter ways. Some members of the group were in the process of opening a shelter for abused women when they were arrested, including a man who donated land for the project. He was later released, but others were not.

The activists were detained last year as the kingdom was preparing to lift its ban on women driving, leading many to assume that Crown Prince Mohammed bin Salman, the kingdom’s day-to-day ruler, did not want to share credit for the change with activists who had pushed for it.