The attorney for a Detroit-area doctor accused of mutilating the genitals of young girls acknowledges that her client performed the procedure, but she says it was part of a religious practice.

The revelation came during a detention hearing on Monday, a few days after Jumana Nagarwala was charged in what authorities say is the first case of its kind in the country. Shannon Smith said in federal court in Michigan that her client removed the girls’ genital membrane as part of a custom practiced by the Dawoodi Bohra, a small sect of Indian Muslims of which Nagarwala is a part, the Detroit Free-Press reported.

Nagarwala, 44, of Northville, Mich., was charged last week with female genital mutilation, transportation with intent to engage in criminal sexual activity and making a false statement to a federal officer. Federal investigators say she performed genital mutilations on two 7-year-old girls at a medical clinic in Livonia, just outside Detroit. The procedures were performed secretly after business hours and without medical billing records, according to a criminal complaint.

Nagarwala, an emergency room doctor for the Henry Ford Health System in Detroit, initially denied performing genital mutilation on children. She told investigators earlier this month that she’s aware the procedure is illegal in the United States.

During the hearing, a federal judge decided to keep Nagarwala incarcerated while the criminal case is pending.

“I think there’s clear and convincing evidence that your client poses a danger to the community,” U.S. Magistrate Judge Mona Majzoub said, according to the Detroit Free-Press.

According to the complaint, the girls’ family traveled last February from Minnesota to Michigan, where they were brought to see Nagarwala. One of the girls told investigators that she was taken to Michigan for a “special” girls’ trip. In describing the procedure, she said it was “to get the germs out.” The other girl said she screamed after a painful “shot.” Both girls said they were told to not talk about what happened.

Nagarwala is one of two Michigan doctors arrested in connection to genital mutilation this past week.

Authorities arrested another doctor, Fakhruddin Attar, 53, and his wife, Farida Attar, 50, both of Livonia, Mich., on Friday. Federal prosecutors say Fakhruddin Attar owns the clinic where Nagarwala performed genital mutilations, while his wife, the clinic’s office manager, assisted during the procedures.

The Attars have been charged with conspiring to perform female genital mutilations on minor girls.

Fakhruddin Attar told investigators that Nagarwala saw patients, girls between ages 6 and 9, at his clinic about five to six times a year, according to a criminal complaint unsealed Friday. He said Nagarwala saw the patients for problems with their genitals, including treatment of rashes. The visits were usually after clinic hours, on Friday evenings or Saturdays, he told investigators.

His wife, Farida, comforted the girls during the examinations by holding their hands, Fakhruddin Attar told investigators.

Investigators say they believe that Nagarwala mutilated the genitals of several other children at Attar’s clinic between 2005 and 2017.

Federal child forensic interviewers have talked to several Michigan children who said that Nagarwala had performed genital mutilation on them. Two parents said the doctor performed the procedure on their daughter, while others denied knowing anything about it, according to the complaint.

Investigators also say that Nagarwala and the Attars are members of the same religious community.

Female genital mutilation remains common among the Dawoodi Bohras who mainly live in India. But some members of the religious community have come out to rebel against the practice, according to a report by the Los Angeles Times.

Two online petitions, started by a group called Speak out on FGM, is seeking to end female genital mutilation in India and has so far garnered a total of more than 200,000 signatures. The practice is known as “khatna” in the Dawoodi Bohra community.

One of the petitions’ writers argued that the practice, held in secret and usually without consent, is more of a cultural one, and “has nothing to do with religion.”

“The Dawoodi Bohras are amongst the most educated in India, yet we are also the only Muslim community in India to practice FGM,” the writer wrote. “Most of us are too scared to speak out publicly. We fear ostracization, social boycott and exclusion of our families from the rest of the community by our religious clergy if we object to the continuation of this practice.”

Female genital mutilation — or removing all or part of a female’s genital for nonmedical reasons — is considered a human rights violation, though it is practiced extensively in some African countries and areas of the Middle East, according to UNICEF. A June 2016 report from the Government Accountability Office found that increased immigration from countries where it is practiced had brought it to the United States, and the Centers for Disease Control and Prevention estimated that in 2012, 513,000 women and girls here were “at risk of or had been subjected” to it.

The report also found that while female genital mutilation was a crime under federal and many state laws, there were few investigations or prosecutions stemming from it — because of underreporting and other problems, The Washington Post’s Matt Zapotosky reported. The report said the FBI had two investigations from 1997 to 2015, one which resulted in a prosecution on other charges. Department of Justice officials indicated to the Government Accountability Office they were aware of two state prosecutions involving the practice.

Matt Zapotosky contributed to this report.