— A veterinarian who treated the baby who died of pneumonia at a San Francisco hospital has resigned amid allegations he inappropriately touched patients.

Vicente M. Gomez, the director of the veterinary clinic at the Santa Clara Valley Veterinary Hospital, resigned Monday after a Los Angeles County Superior Court judge ruled that he violated patient privacy laws by touching a patient without his consent and recording his movements on his phone.

The judge said Gomez’s actions were illegal, since he was not a licensed veterinarian.

Gomez is not charged with any crime, but the judge found that he had not demonstrated that he intended to comply with the privacy laws.

Miguel M. Rivera, who worked as Gomez’s deputy at the clinic from January to March, has also resigned.

The investigation into the alleged incidents began after the baby died of the respiratory illness at the San Francisco General Hospital in March.

The boy’s mother and sister told investigators they witnessed Gomez touching the infant and recording the actions.

The Los Angeles Times reported that Gomez had allegedly kissed the infant while the infant was sleeping.

The mother and other family members told investigators that Gomez took their phone and started recording their conversations.

The family said Gomez then touched the infant, who was lying on a bed, on his knee.

The family told investigators Gomez took a camera and a cellphone from the infant’s room, and began recording conversations with family members.

The parents and other child witnesses told investigators their phones had been turned off for a month.

The child was later diagnosed with pneumonia and died.

Municipal officials told the newspaper that Gomez admitted to the incident, but he said he did not remember the events.

He did not respond to a request for comment Monday.

In a statement Monday, the city said it was cooperating with the investigation and that it “strongly disagrees” with the judge’s ruling.

The statement said Gomez was removed from the clinic because he was involved in inappropriate and inappropriate conduct with a patient, and that the allegations are without merit.

The Santa Clara County Sheriff’s Office said it has launched an internal review.