Armando Gonzalez, 46, faces up to 12 years in prison when he is sentenced Aug. 17.
The video camera was discovered Jan. 9 at the Border Patrol facility in San Ysidro. Gonzalez told his superiors that he placed the camera in the restroom because he suspected drug use by one of his employees.
As part of his plea bargain, Gonzalez admitted that wasn't true.
Gonzalez also pleaded guilty to seven counts of video voyeurism involving women who were recorded without their knowledge as they used the restroom or changed clothes between July 2013 and April 2014.
Investigators searched the defendant's office in February and found video files containing images recorded inside the restroom that showed the private areas of multiple female victims.
Gonzalez, who has been with the Border Patrol for 20 years, has not been allowed back in his office since the case began, said his attorney, Gretchen von Helms.