A leopard has killed a two-year-old boy inside a fenced-off staff compound at South Africa’s Kruger national park, officials said.

“The toddler was only 30 months old,” the park said in a statement on Thursday. “The boy was certified dead by doctors at the Shongwe hospital after being rushed there by family members.”

The leopard attacked the boy on Wednesday evening after getting into the staff living quarters, which are separated from the rest of the park by an electrified fence.

A team of rangers hunted down the big cat and shot it dead to avoid the risk of a repeat, said the park, adding that it may have attacked as it was too accustomed to contact with humans.

“In parks like the KNP (Kruger national park) predators do interact with tourists and staff and at times it may result in species like leopard getting habituated to people and losing their fear,” the park said.

“The change in natural behaviour can then lead to unfortunate incidents such as this.”

The KNP said attacks were a danger faced by all staff and family members living and working in the park, but were very rare.

“This is the risk we live with on a daily basis as we help conserve our species for the benefit of all,” said Fundisile Mketeni, head of South African National Parks, offering condolences to the boy’s family.

Kruger covers nearly 2m hectares (4.9m acres) and is home to over 500 bird species and 147 mammal species.

The attack occurred near Crocodile Bridge, a tourist rest camp near the park’s southern boundary.