Carpet pythons often make a meal of green tree frogs but a new video has shown the tables being turned, with one of the amphibians exacting revenge by chomping down on a snake.

The 28-second clip taken in the Darwin suburb of Malak on Saturday night shows a green tree frog with a baby carpet python being eaten headfirst, and the snake part way into its stomach.

Once the feisty frog is found by Mark Drescher, who lives in the home, it clings to the still wriggling snake and refuses to relinquish it, even holding on while the snake is lifted into the air.

At an estimated 50 centimetres long, the snake would appear a difficult meal for the much smaller frog, but there was no sign of the frog giving up its efforts.

"The frog was downstairs under the house when I found it, moving around with what I thought was a lizard's tail wriggling in its mouth," Mr Drescher said.

"Only when I had a closer look did I realise it was a small snake."

Mr Drescher said he thought about letting the battle between the two animals continue, but in the end decided to intervene.

"I was in two minds as to let it continue but couldn't see that the frog given its size would be successful and [it would be] most unpleasant for the snake, which was obviously well and truly alive, [so I] decided to intervene," he said.

A green tree frog tries to devour a carpet python. ( Supplied: Mark Drescher )

He said he lifted up the snake and gave it a gentle tug, but the frog held on doggedly.

"The snake once free was rearing and hissing and though not happy didn't look to have suffered any ill effects," he said.

The snake was then released into his garden.

Dr Gavin Bedford, snake expert and curator of reptiles at Crocosaurus Cove, said it was unusual for a small animal like a frog to try and eat a larger snake.

"Carpet pythons are known on occasion to eat frogs, so the tables are turned," Dr Bedford said.

He said despite snakes not being a common part of a frog's diet, it had been documented before.

"They will digest anything they can get into their guts," he said.

The frog was fortunate the python he encountered was a baby carpet snake, as the reptiles can grow to three metres in length, more than a mouthful for even the hungriest frog.

It is not the first time unlikely predators have taken on much larger animals.

In March 2014 a Queensland snake killed and ate a crocodile, making news around the world.