Edward. M. "Ted" Kennedy, the Democratic "liberal lion" who for nearly 50 years represented Massachusetts in the U.S. Senate, died Wednesday morning at his home on Cape Cod more than a year after he announced he had been diagnosed with a malignant brain tumor.

He was 77.

Doctors at Massachusetts General Hospital in Boston discovered in May 2008 that Kennedy had a malignant glioma on his left parietal lobe after he'd suffered several seizures at the Kennedy Compound in Hyannis Port days earlier.

From the beginning, Kennedy beat the odds.

"For a man is his 70s, he did very, very well," Dr. Michael Gruber, professor of neurology and neurosurgery at NYU School of Medicine and Director of the Brain Tumor Center in Summit, New Jersey, told FOXNews.com. "He was walking unassisted (up until the end), he was lucid."

At the time of Kennedy's diagnosis, Dr. Suriya Jeyapalan, a neuroncologist at Beth Israel Deaconess Medical Center in Boston, said that Kennedy's condition was treatable, but not curable.

"You can put it into remission for a while, but it's not a curable tumor," she said.

More than 18,000 primary malignant brain tumors are diagnosed each year in the United States; about 9,000 of those are malignant gliomas, according to the National Cancer Institute.

In general, half of all patients die within a year.

These tumors are the second-most common cause of cancer deaths in the 15 to 44 age group. Median survival for patients with moderately severe malignant gliomas is three to five years.

However, patients with malignant gliomas often maintain a very good quality of life after their diagnosis, Gruber said, as was evident with Kennedy, who continued making public appearances and speeches up until about a month before his death.

"Most people with brain tumors can go on living their everyday lives and function at a high level," said Gruber, who did not treat Kennedy. "They continue to work, travel. Only a small percentage are impaired because their vision is affected or they are having seizures. Each case is different. Some people have a better go at it than others."

Gruber said the fate of a brain tumor patient depends on the tumor's "real estate." For example, if the tumor is located on the frontal or temporal lobe, then the patient's speech might be affected. Since Kennedy's tumor was on the left parietal lobe, he suffered seizures. Other brain tumor patients may lose the ability to walk, lose vision or lose comprehension skills, depending on where the tumor lies or if the tumor invades other parts of the brain.

Kennedy underwent targeted brain surgery on June 2, 2008 at Duke University Medical Center. The surgery lasted for about 3 1/2 hours and Kennedy spent some of that time awake.

Targeted brain surgery is a delicate balance — removing as much tumor as possible improves cancer control, but there's also the risk of harming the healthy brain tissue that lets patients walk and talk.

This is why doctors keep patients awake and talking during the surgery to make sure they're steering clear of delicate areas of the brain. The surgery, considered a success, was followed by months of chemo and radiation therapy.

Kennedy has suffered other health problems over the years.

In October 2007, doctors performed surgery to clean out a partially blocked neck artery, which left untreated, could have trigged a stroke.

In 1964, Kennedy suffered several fractured bones in his back, broken ribs, and internal bleeding after he was involved in a plane crash.

Two people died in that crash.

The Associated Press contributed to this story.