A Maryland father of two hid video cameras in his bathroom and secretly recorded at least 30 young girls as they took off their clothes or bathing suits, took showers and got dressed, federal officials said Friday.

Jonathan Oldale, 54, was accused of recording hundreds of videos, and a criminal complaint said some of the girls were recorded after playing in “splash” parties in his back yard.

“Mr. Oldale told the children that they needed to take showers before they left,” Assistant U.S. Attorney Joseph R. Baldwin said in court Friday.

Oldale appeared Friday in U.S. District Court in Greenbelt to face a charge of production of child pornography. He faces at least 15 years in prison and up to 30 years, authorities said.

During a hearing that lasted more than an hour, Oldale’s wife, Alison, spoke briefly, asking that he be allowed to stay at home with her and his children. Oldale appeared in a black T-shirt, jeans and sandals with no socks.

U.S. Magistrate Judge Timothy J. Sullivan ordered Oldale ­detained pending his trial.

Jonathan Oldale, 54, faces 15 to 30 years in prison. His attorney didn’t dispute that he placed the cameras. (Montgomery County Police Department)

Prosecutors argued that he remained a threat if released — both in terms of access to children and to the Internet. They also said he was a flight risk, given the time in prison he is facing if convicted. Oldale was born in the United Kingdom and has traveled extensively.

Oldale’s attorney, Laura Rhodes, acknowledged her client had positioned the cameras.

“We’re not disputing that Mr. Oldale did place the cameras at the gymnastics location and in his own home,” she said. “He began therapy in July after the second search warrant of the home.”

Rhodes said her client would like to have time with his wife and two children before the trial. She noted that whatever videos were found, no evidence exists that Oldale ever touched children inappropriately.

“No one has ever indicated that he has inappropriately touched them,” she said.

In the suburban Maryland hamlet of Somerset, population 1,200, the case has horrified residents, some of whom were actively helping police identify possible victims in recent weeks.

Oldale was at one time regarded as an intensely involved father who led a Cub Scout pack, took photos for the elementary school yearbook, volunteered as a room parent, launched a small summer camp and opened a home-based music school.

He was a fixture at the neighborhood pool and threw backyard parties with waterslides — activities that have left many parents worried that their children were targets.

“People are pretty shocked that something like this can happen in a town like Somerset, which is pretty close to Mayberry,” parent Aron Schwartz said. “This is a community that is very close, with lots of families, and people feel like they know one another, and it’s surprising — very surprising — that we apparently did not know something really important about one of our neighbors.”

The case came to light in October, when Montgomery County police announced Oldale’s arrest, accusing him of placing a hidden camera in a bathroom at Silver Stars Gymnastics, a popular business in Silver Spring that offers children’s classes, birthday parties and summer camps.

According to court documents, a Silver Stars employee found a backpack inside a restroom, under a wet-floor sign near the toilet. The employee noticed a light coming from what appeared to be a car key fob but turned out to be a recording device.

The backpack was traced to Oldale, who was alleged to have left a backpack in a similar position three weeks earlier.

Police said in October no images were recorded at Silver Stars.

Oldale was charged with one count of conducting visual surveillance, with prurient intent, of another person in a private place without consent.

Police first searched his home in May, seizing electronic devices. On Friday, authorities said a browser had been installed that enables anonymous communication with the “dark web,” where exploitative images of children have been illegally distributed and shared. Investigators also found computer artifacts that indicated the user accessed files with names linked to child-exploitation material.

Montgomery County police searched Oldale’s home again in July, finding cameras with memory cards in his office. The cards contained hundreds of videos filmed in the bathroom of his home, officials said.

The videos show that multiple cameras were used simultaneously to record what was happening in the bathroom, authorities said, and they show Oldale checking camera angles.

As the investigation — involving the FBI and Montgomery County Police — was underway, Oldale remained a regular presence in the community, parents said, despite being banned from school property in Montgomery County.

School district officials said they ordered a sweep for recording devices in the schools where Oldale spent time, Somerset Elementary and Westland Middle. None was located, said schools spokesman Derek Turner.

In the town of Somerset, a security sweep of the pool also turned up no recording equipment, officials said.

In recent weeks, residents grew more alarmed, as information about the investigation traveled through the community and more children were identified in the images.

“There is a tremendous sense of relief in the community,” said Lyric Winik, the PTA president at Westland Middle School. “Hopefully, we can support and care for the families and children who have been impacted by this and we can help them feel safe and secure again.”

The PTAs at the Westland and Somerset schools planned to send letters to families, as did the Montgomery County school system.

Winik said Oldale’s arrest may be difficult for many parents, leaving open the question of whether their children were ever filmed. Authorities have said they have not completed their investigation.

“As this becomes more public,” Winik said, “there’s going to be a lot more wondering: Is my child one of the victims?”