A former Legal Aid Society lawyer pleaded guilty Wednesday to illegally using a hidden video camera to spy on female co-workers as they changed clothes in their offices.

Peter Barta, 32, of Queens, used a camera hidden in a clock to videotape five co-workers in the public defense agency’s Manhattan offices, recording at least one woman with her breasts and buttocks bared.