By just about any measure, Andrew Hey wrapped up a brilliant student career when he graduated from Lexington's Tates Creek High School this month.

He was one of the highest-ranking students in his class academically. He was a four-year varsity swimmer; he loved drama and performed in six plays over four years at Tates Creek; and he still managed to become an Eagle Scout when he was a sophomore.

But graduation didn't come easily — and that doesn't just refer to all the study and hard work.

Barely halfway through his junior year, Andrew underwent risky brain surgery to remove a golf-ball-size tumor that caused him to have seizures.

"I knew it was serious, but I didn't know how serious," his father, Jim Hey, said. "As it turned out, it was very serious."

Fortunately, Andrew bounced back from the operation. He put in brutally long hours making up the school work he'd missed, refusing to drop any tough classes to make it easier.

Now 18, he'll enroll at Vanderbilt University in August, majoring in neuroscience. He intends to enter medical school, with the goal of becoming a neurosurgeon. He hopes to help kids facing the same kind of problem he experienced.

"I knew before that I wanted to go into medicine, but I didn't know what field," Andrew said. "This helped focus my interest."

Things look so bright for Andrew now that it all might sound like the script of a made-for-TV movie.

But in real life, things are seldom so clear-cut.

Andrew Hey (the name is pronounced "High") was born in New York, and has lived in various parts of the United States and Europe, including Paris and Amsterdam.

He was a straight-A student and well-rounded, with an array of interests that kept growing. Not long ago, for example, he took up the piano and now hopes to minor in music at Vanderbilt.

Then, everything in Andrew's life was thrown into doubt.

He collapsed while taking a math exam on Feb. 28, 2013, losing consciousness for several minutes. Doctors confirmed that he had suffered a seizure.

An MRI scan detected the tumor, growing in the center of Andrew's brain and extending into his speech-control centers. Even worse, surgeons said that removing the lesion could pose a 60 percent risk of Andrew losing his ability to speak, and possibly losing movement on his right side.

"It was the scariest moment of my life," he said.

Doctors now think the tumor probably started when Andrew was about 7 years old. As a child, he occasionally would sense strange smells, accompanied by bouts of vomiting or dry heaves. Doctors think they were partial seizures caused by the slow-growing tumor.

Surgeons advised that without an operation, the tumor would keep growing and the seizures would get worse. There also was a chance the tumor was malignant.

Andrew and his father decided to go ahead with the surgery, which involved Andrew remaining awake during the procedure.

The operation went well, and the tumor proved to be benign. Andrew recovered quickly but returned to school in March 2013 far behind in his studies. He was determined to catch up.

For the rest of the school year, Andrew arrived at Tates Creek an hour and a half early every day and stayed two hours late, studying hard to recover the lost time.

Dropping out of the International Baccalaureate program could have made things easier, but Andrew rejected the idea.

He pulled a few Bs during his arduous regimen last year — something he wasn't used to — but got back on track.

"It was a pretty remarkable," his father said. "Andrew is such a determined, focused kid; once he gets his mind set on something he doesn't let go."

The news since then has been good, but uncertainty remains.

Surgeons at the University of Kentucky couldn't remove all of the brain tumor because doing so could have threatened Andrew's speech.

Recent MRI scans — including one this month — have shown the lesion isn't growing. But there are no guarantees.

"They've told us that in eight or 10 years Andrew might need chemo and radiation to stop the tumor, or even more aggressive surgery," Jim Hey said. "He'll have to live with this for the rest of his life."

Andrew hopes that better treatments will be developed that could solve his problem. But for now, he's moving ahead with his life.

"I know I have an uncertain future, and I'm a little scared by that," he said. "But I'd really like to spend my life helping people with brain tumors and epilepsy, and perhaps see if there is a way to cure cancer."

Larry Waldrop, a counselor at Tates Creek, has worked with Andrew the past two years. He wrote letters of recommendation for Andrew to 21 colleges and universities. Waldrop calls him "a remarkable young man."

"We've become closer because of everything he's gone through," he said. "He's a very bright, independent student who has set some high bars that he wants to reach. I can't imagine being his age and facing what he had to face last year. But he's been an inspiration to everybody."

Andrew said he would advise others in tough situations to "never lose hope."

"I've grown closer to God since this happened," he said. "I think he really saved my life so he could put me on this path to help other people.

"God always has a plan for you, and that plan will always be for the better."