PORTLAND, Maine — Thiwat Thiwat remembers stealing the ball during the first play of a basketball game the summer before his senior year at Deering High School and, instead of feeling a surge of adrenaline, being suddenly overcome with fatigue.

“It was a good play,” said the 21-year-old, who was a standout on Deering’s 2012 state championship team. “But I was so tired, I told the coach I had to come out.”

That fatigue was the first indication he ever had that something might be amiss, Thiwat said Thursday from a bed at Maine Medical Center. Not long after, he was diagnosed with kidney failure and began medication.

Three years later, Thiwat has completed two years of college, and he is registered to begin summer accounting and psychology classes on Tuesday at the University of Southern Maine. The classes are prerequisites that would allow him to transfer to the University of Maine, where Bob Walsh — who recruited Thiwat and Deering teammate Labson Abwoch to play at Rhode Island College when Walsh coached there — is now head coach.

Thiwat attended Southern Maine Community College during the past year, although he said, “[I] could definitely tell my body wasn’t 100 percent. But I told myself, I just gotta keep doing what I’m doing.”

In recent weeks, he felt more fatigued and suffered from headaches, back pain and water retention. During a routine visit on Monday, his nephrologist told Thiwat that his kidney function was dangerously low, and he was admitted to the hospital.

“When he came in on Monday it was at 1 percent,” said Cindi Taylor, a Portland teacher who has been Thiwat’s second mom since he was in her English Language Learner kindergarten class shortly after arriving in the United States from South Sudan in 1999. “He’s teetering on the edge of kidney failure.”

Thiwat came to the United States when he was 4 years old with his father, an uncle, and several siblings and cousins. The family left war-torn Sudan and spent time in an Ethiopian refugee camp, where Thiwat was born, before coming to Maine. He became a citizen the summer after graduating from high school.

“I’m a Mainer,” he said Wednesday. “There’s no way around that.”

Taylor said Thiwat came to live with her during his high school years, but his longtime AAU (Amateur Athletic Union) coach, Walter Phillips, remembers that if he needed to find Thiwat when he was 10 or 11, “He was at Cindi’s house. Cindi took care of that boy.”

Thiwat attended Portland schools and, in 2012, was a member of the state championship Deering High School basketball team.

That fall, after the basketball game in Massachusetts, a nephrologist found a protein leak and traces of blood in his urine, and a biopsy determined his kidneys were failing. He’d just turned 18.

Thiwat completed his first year at Rhode Island College, but he didn’t play ball. As his kidney function deteriorated, he returned to Maine to live with his “foster grandmother,” Bonnie Kam. He has just completed his sophomore year at Southern Maine Community College while working as a security guard at Texas Instruments.

“Thiwat is just a special kid,” Phillips said Thursday. “There’s no question about it. Not only is he a great kid, but coming from what he has had to deal with in his life … he’s unbelievable. And as far as a basketball player, he’s everything a coach would want in a player. He’s one of those kids who’s able to be a sweetheart off the court and then be able to switch and be aggressive on the court.”

On Monday, when he arrived at Maine Medical Center, Thiwat learned that his MaineCare health insurance ended when he turned 21 in October.

Maine Medical Center will provide free care while he’s an inpatient — and on Thursday agreed to cover outpatient dialysis until he can find insurance — but until he finds insurance, he can’t get on the list for a kidney transplant.

A representative of Change Healthcare, at MMC, is working with Thiwat to see if he can qualify for Social Security Disability or “emergency” MaineCare, Taylor said, but such an application can take months to get approval.

A Maine Department of Health and Human Services representative did not immediately return a phone call seeking information on “emergency” MaineCare.

Meanwhile, Thiwat tries to remain patient.

“The thing that bugs me about this is I kept my hands clean all throughout high school,” Thiwat said. “I had so many opportunities to mess up in life, but I kept my hands clean. And for me to go through this and not have the support of my state, especially at 21, when I have my whole life to live, and to not be taken care of in my time of need.”

Friends have posted good wishes on Taylor’s Facebook page, and one friend is setting up a GoFundMe page. Others have offered to be tested to see if they’d be a match for a transplant, but Taylor said Thiwat needs insurance first.

For now, Thiwat will stay at the hospital, his 6 foot, 4 inch body curled in the standard-size bed as he endures blood pressure checks and accepts bowls of Jello with a smile. Taylor said his doctor won’t discharge him until he’s stabilized and outpatient dialysis is arranged. They hope that will be early next week.

Taylor said she’s explained to Thiwat that he may be fatigued or feel other effects from the dialysis, but Thiwat is determined to be in class on Tuesday.

“I’m hopeful things will go in the right direction and I’ll be able to take my summer courses so I can reach my goal of attending the University of Maine in the fall,” he said.