Two years ago while fleeing an assailant in Thailand, Hannah Gavios fell 150 feet off a cliff and fractured her spine. There was a chance she might never walk again. Now the 25-year-old Queens native is prepping to run the New York City Marathon on Nov. 4.

“I’m going to be a functioning human — I don’t want to feel like I’m left behind,” she told The Post.

Although she is still unable to feel her feet and ankles and relies on crutches, Gavios is training up to six hours and 16 miles a day for her first marathon. She is running to raise money for spinal cord research through the Christopher and Dana Reeve Foundation.

While teaching English and traveling through Southeast Asia in September 2016, Gavios arrived near Railay Beach in Krabi, Thailand, and went to a shop where she asked for directions to her hotel. Apai Ruangwong, a 28-year-old local, offered to show her the way. Instead, he led her into a wooded area and attacked her.

Gavios punched him in the face and bit his ear and fled in the dark. Not knowing where she was going, she fell off the cliff, hitting her head along the way.

After she landed but was unable to move, Gavios called out for help — and was found by Ruangwong, who sexually assaulted her for 10 hours until locals saved her.

She thought she was going to die after the attack, for which her assailant was sentenced to a maximum of five years in prison after pleading guilty to obscene behavior.

Gavios was admitted to a Thai hospital and underwent emergency spinal surgery. Her prognosis was grim. “The doctors were a little negative [about my ability to walk],” she told The Post. “I was scared that I’d never be able to move or feel my feet again.”

Less than three weeks later, she was transferred to Mt. Sinai Hospital, then moved to her parents’ Queens home a couple of months after that. She needed four people to hold her up.

“I was so wobbly in the beginning that my mom fainted,” Gavios recalled. “It was scary to see my muscles atrophy and wasting away.”

With more than a year of intensive physical therapy, she learned to walk with crutches and leg braces.

“I have to work extra, extra hard just to walk a block, to get up the stairs,” she said. “But all that hard work makes me a stronger person.”

She has even been able to climb Breakneck Ridge upstate, get her yoga teaching certification and work out at rock-climbing gyms. Hiking, she said, “has been a part of my recovery and of finding peace and happiness . . . In certain ways, I feel more confident about my body now.”

Last year, she returned to Thailand with friends and visited a beach not far from the scene of the attack. “When I saw the tall cliffs, it did bring me back,” Gavios recalled. “But it ended up being a positive experience. I know that . . . most people are good.”

Still, she recently began studying the self-defense martial art Krav Maga. “Now I feel safer when I’m walking around or marathon training,” she said.

Over the summer, she moved into her own place, and the FIT grad is working as a graphic designer at fashion brand Nautica.

She admits some of her friends and family members were at first skeptical about her tackling the marathon. “A lot of people were scared and nervous,” Gavios said.

But she is determined to do it. “I don’t think the time really matters,” she explained. “I might be out there for 12 hours or more, but the goal is finishing it.”

Incredibly, Gavios uses the attack as a motivator.

“I know that if I lived through that — being tortured and suffering for so many hours straight — then the marathon should not be a big deal.”