A man ejected from a pub in Australia broke into a zoo and climbed onto the back of a crocodile, which bit him on the leg before letting him go. Police said the man had a lucky escape.

The 36-year-old, who police said had been thrown out of a pub for being drunk, told officials he scaled the barbed wire fence surrounding the Broome crocodile park in north-west Australia on Monday night because he wanted to give the 5 metre long animal, called Fatso, a pat.

"He attempted to sit on its back and the croc has taken offence and spun around and bit him on the right leg," police sergeant Roger Haynes said.

The saltwater crocodile then inexplicably let the man go, and he climbed back over the fence to safety.

The man, a tourist whose name was not released, suffered some "very nasty lacerations" and was taken to a hospital, said Haynes.

"Saltwater crocodiles ... once they get hold of you, are not renowned for letting you go," Haynes said. "He's lucky to have escaped with his life."

Saltwater crocodiles are the world's largest reptile and can grow up to 7 metres. They have become increasingly common in Australia's tropical north since hunting, which almost extinguished the species, was banned in 1971.