(CNN) It was supposed to be a solitary day of fishing.

But an off-duty Australian wildlife ranger caught more than he bargained for when he was attacked by a crocodile -- and lived to tell the tale after poking it in the eye to make a narrow escape.

Craig Dickmann, 54, was fly fishing alone on a beach in Cape York, Queensland state, on Sunday when the 2.5-meter-long (8.2 feet) reptile lunged at him, according to CNN affiliate 7 News

The crocodile grabbed the ranger by his legs and hand, and tried to drag him down, 7 News reported. Dickmann scuffled with the crocodile, then gouged it in the eye -- which finally forced the beast to release him from its jaws.

"I can only imagine it was a life or death response," said Queensland Ambulance Service Superintendent Warren Martin.