OAKLAND, Calif. (AP) — Alameda County sheriff’s office will no longer require women arrested and booked into the county jail to undergo a pregnancy test under the terms of a settlement.

The American Civil Liberties Union of Northern California announced Wednesday it had settled its lawsuit against the Sheriff’s Office challenging the pregnancy test requirement. The civil liberties group sued the sheriff’s office last year on behalf of women — one of them 69 — who said the requirement was humiliating, invasive and offensive.

READ MORE: Pedestrian Walking On Interstate 80 In Vacaville Hit, Killed

Sheriff’s Sgt. J.D. Nelson said a judge had required the tests in response to a lawsuit alleging women inmates were not receiving adequate prenatal care.

READ MORE: Critics Bid To Overturn Approval Of Squaw Valley Resort Expansion

The ACLU said the test will now be optional and only administered by medical staff.

MORE NEWS: US Seeks To Drop UC Davis Chinese Researcher's Visa Fraud Case Ahead Of Trial

© Copyright 2015 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.