A quick-thinking police officer rescued a toddler whose father allegedly flung her from a rooftop as he tried to protest authorities looking to demolish his home, an illegal shack, in South Africa.

A video showed a police officer trying to negotiate with the distressed father as he dangled his one-year-old daughter by her ankle to keep the officers from demolishing his home.

The standoff occurred after authorities requested the removal of 90 shacks built illegally in Joe Slovo township in Kwadwesi, located on South Africa’s east coast.

Six officers from the South African Police Service who were at the scene stealthily positioned themselves beneath the father standing on the roof in case something were to happen to the child.

One of the officers on the roof engaging in a standoff with the father warned his fellow officers waiting below that the father would drop the child. Meanwhile, village protesters egged him on, shouting, “Throw, throw, throw!”

After several false alarms, the father allegedly flung the one-year-old from the roof before one of the officers came to her rescue.

Moments later, three other officers on the roof tackled the father to the ground and arrested him.

A local news outlet reported that the father faces a charge of attempted murder and that the daughter will remain in her mother’s custody while social services monitors the situation.