ST. CLOUD, Fla. -

A 9-year-old boy was able to fight off a large alligator Thursday afternoon in an Osceola County lake, wildlife officials said.

[LISTEN:  911 call released in alligator attack]

The attack happened around 2:20 p.m. in East Lake Tohopekaliga near Lakeshore Boulevard in St. Cloud, according to the Florida Fish and Wildlife Conservation Commission.

Wildlife officials said the boy was riding his bicycle when he decided to swim in a non-swimming area of the lake.

With bite marks on his leg and pain in his body, James Barrny is a lot better off than what you'd expect after fighting off a 9-foot gator.

"He was just at the lakefront playing, and him and a couple of his friends -- and they got in the water -- they were swimming around, an alligator came up and just snatched him," said James' grandfather, John Hayes.

"He heard him screaming and then we didn't know what happened ... he was crawling up the shore, screaming and crying with gator bites all over his back and scratches," said the boy's friend, who called 911.

Hayes said his grandson thought it was his friends playing with him.

"He was scared to death. He thought one of his friends was poking him and then all of a sudden it just grabbed him," said Hayes.

The next seconds would be crucial to surviving.

"Then he was fighting with it, hitting it in the face and it finally opened its mouth a little bit, and he hit it again in the eye and he got away from it," Hayes recalled to Local 6.

"If he really got a hold of him in the water, I don't know how he got out. Let's put it that way," said Joe Elsebough, with Snapper Trapperz.

Elsebough calls James a tough boy, and he'd know. For hours into the night, Joe tried to catch the 500-pound gator, but it was so powerful it snapped the line.

"It's amazing. I can't believe he did that, but it was really cool he did. He's going to be OK," said Hayes.

James managed to escape with non-life-threatening injuries.  He underwent surgery to clean his wounds on Friday.

James also ended up with one of the gator's teeth.

The city of St. Cloud closed nearby swimming areas of the lake until further notice.

The trapper returned Friday morning to try to catch the gator.

Watch Local 6 News and stay with ClickOrlando.com for more on this story.