New research shows the brain has the ability to function well — and even excel — in old age. The secret? Keep learning.

"Learning is the mechanism for development no matter how old you are," said Rachel Wu, an assistant professor of psychology at the University of California Riverside and the author of research published Wednesday in the Journals of Gerontology, Series B.

Wu's study took an ambitious approach: have seniors in their 60s, 70s and 80s immerse themselves in a college-like atmosphere, enrolling in three somewhat rigorous courses simultaneously.

They participated in at least 15 hours of class a week, and also did homework assignments, over three months. Classes included Spanish language, music composition, painting/drawing, photography and instruction on using an iPad.

The results were impressive: After just six weeks, participants' scores on standardized tests assessing thinking and memory abilities were similar to a middle-age adult's scores — a significant improvement over their scores before the study began.

That is, their brains functioned more like those of a person 30 years younger.

"Many people think their ceiling is half of where they could actually go," Wu said. "But if you have a coach helping you, you'll find your limit is way further than you thought."

It's important to note that the study was small, including just 42 participants who were all cognitively healthy from the start and were motivated to learn.

Still, outside experts call the findings important and optimistic.

"As we age, our brain becomes different, but it doesn't stop. The brain is still working," said Dr. Laurie Archbald-Pannone, an associate professor of geriatric medicine at the University of Virginia and medical director of the geriatric clinic at the Jefferson Area Board for Aging in Charlottesville, Virginia.

James Ryan, 72, credits the "heavy-duty concentration" involved in painting landscapes for boosting his brain health. Courtesy of Rachel Wu

"Aging is not a disease. It's part of the normal process of life," she added. "The brain may work differently, but still engaging the brain is really important."

Other aging experts agreed. "When it comes to brain function, our neurons do slow down a bit, but our ability to think really shouldn't change," said Dr. Michael Wasserman, a geriatrician in Woodland Hills, California, and member of the nonprofit American Geriatrics Society.

"If you actively use your brain, you should maintain your cognitive function," he said. Neither Archbald-Pannone nor Wasserman were involved in the new research.

Getting old scares the heck out of everybody, you know?

One participant, James Ryan, 72, of Moreno Valley, California, signed up for the study because he was eager to keep his mind sharp after retirement. "Getting old scares the heck out of everybody, you know?" he said.

"But as long as you can stay on top of the game, the better you're going to be," Ryan told NBC News.

At the outset, he was not concerned about the Spanish class. "I knew it would be a lot of studying, but I could commit to that," he said.

The iPad class did not faze him, either, because he'd spent 50 years working with computers: first as an air traffic controller with the U.S. Air Force, then at a radar facility with Customs and Border Protection.

But without much art experience, the painting and drawing classes were daunting. "I thought I would embarrass myself," Ryan said. He was wrong.

"I found out I can paint! I was pleasantly surprised, and my family was like, 'Dad, we didn't know you could do this!'"

What's more, Ryan's confidence in learning held after the study ended. Now when something around the house breaks, he goes on YouTube to figure out how to fix it. That's something Ryan says he would not have done before.

And he credits the art classes with his improved cognition scores.

"People don't realize that when you do a landscape, it takes hours. I put in a tremendous amount of time," Ryan said. "I think that is the thing that created those extra neurons and pathways to make my cognitive skills on the test show up better."

Other participants agreed that the intense learning structure was key.

Bob Grant, 63, helps fellow classmates use GarageBand in a music composition class. Courtesy of Rachel Wu

"Just playing Scrabble is not enough. It doesn't push hard enough," said Bob Grant, 63, of Riverside, California.

Grant also spent his career working with computers, but found he enjoyed his photography, music composition and drawing classes.

"I'm not going to sell my artwork, but I was able to create some nice-looking drawings," he said.

Another important component of the study was the social aspect of being with fellow students.

"I loved being in a classroom," Grant said. "I made a ton of friends, and we encouraged each other."

And he's been inspired to learn how to play the guitar, a skill he's yearned for since high school.

"If you're in a learning situation, you're going to be a lot younger," Wu said. "It's the learning that's driving a lot of the development and growth."

Wasserman said that the study "absolutely validated the fact that no matter how old you are, if you use your brain, you're no different than a younger person."

FOLLOW NBC HEALTH ON TWITTER & FACEBOOK