A man is under arrest after trespassing into an elephant habitat at the San Diego Zoo with his daughter to take a photo with the animals.

The incident took place on Friday when the father surpassed several barriers to gain access to the enclosure and carried his 2-year-old daughter into the elephant habitat, NBC San Diego reports.

Police noted that the man “wanted to take a photo with the African bull elephant.”However, after noticing the two in the enclosure, the elephant appeared agitated and began to charge at the father and daughter.

“This afternoon, March 19, 2021, two guests, despite multiple barriers, purposely and illegally trespassed into a habitat, which is home to our Asian and African elephant,” Zoo spokesman Andrew James wrote in a statement.

“San Diego Zoo security promptly responded to the incident, but the guests had already exited the habitat.”

Matthew Passiglia, who witnessed the incident, told the outlet guests were yelling at the man to leave the elephant enclosure.

“A lot of people froze and didn’t know really how to take it in, then immediately everyone was pleading with him, and then it became frantic and hysterical,” he said.

During the incident, the father reportedly dropped the child while attempting to escape the animal. He was eventually able to get himself and the child out of the elephant habitat safely. The elephant in the enclosure was also unharmed, the San Diego Tribune reports.

Zoo security immediately alerted the San Diego Police Department, which contacted the family and arrested the father.

The man is facing charges of child endangerment as well as a city municipal code violation for trespassing on an animal enclosure.

There are around 400,000 African elephants in the wild today
There are around 400,000 African elephants in the wild today AFP / MONIRUL BHUIYAN