Two brothers pulled off a sweet escape from a leopard in India by throwing a birthday cake at the animal as it chased them while they rode a motorbike, officials said Thursday.

“Your first instinct when you sense danger is to do whatever you can to save yourself. That’s what they did,” a forest official told AFP.

Also read: Woman fights off crocodile to save twin in Mexico lagoon

“They had a cake with them and they threw it at the leopard.”

According to the Times of India, Firoz and Sabir Mansuri were heading at dusk to a birthday party for Firoz’s son in Madhya Pradesh state when the leopard burst out of a sugarcane field.

They accelerated but the big cat gained on them on the muddy path, leaving Sabir, riding pillion, no other option than to lob the box containing the cake at the predator.

Also read: Herd of elephants take snuggle nap after 500 km trek. Photo goes viral

Hit by the “weapon of sweet distraction”, the flummoxed feline gave up its chase and darted back into the fields — and without even trying the cake, the paper said.

“The leopard followed us for over 500 metres (yards). We narrowly escaped death,” it quoted Sabir as saying.

Leopard numbers in India grew more than 60% between 2014 and 2018 to almost 13,000, according to the government, with the highest numbers in Madhya Pradesh.

They are less scared than tigers of people and often enter villages and even towns.

Also read: Meet Cooper, one of the largest dinosaurs to ever roam the Earth

Attacks on adults are rare but children are more at risk. Last month a leopard snatched a four-year-old girl from her garden in Kashmir. Her mutilated body was found the next day.