Meditation exercises could boost mental toughness in soldiers readying for war, keeping them from becoming overly emotional, according to new research.

The study found that mindfulness training, which teaches people how to stay alert and in the moment without becoming emotional (giving them a kind of "mental armor"), improved the moods of U.S. Marines preparing for deployment to Iraq. Practicing mindfulness also improved a type of memory that enables people to complete complex mental tasks.

The key is practicing these mindfulness exercises daily, just as you would any other exercise, according to study co-author and University of Pennsylvania cognitive neuroscientist Amishi Jha said in a statement.

The study involved 48 Marines who were headed to Iraq. During the eight weeks before deployment, 31 of the participants spent two hours in mindfulness training classes each week, while the other 17 men had no mindfulness training. The Marines, all men, were also assigned "homework" — a 30-minute mindfulness exercise each day.

The exercises included include focused breathing and meditation-like sessions. (Past research has found such exercises decrease stress and even prevent relapses in patients with depression.)

During the training, the soldiers answered questionnaires about their moods and took a math and memory test to check their working memory. Working memory, which allows for short-term retrieval and storage of information, is closely related to the kind of mental control used in mindfulness. Jha wanted to know if mindfulness would improve soldiers' ability to control  emotion by improving working memory.

The stress of deployment did decrease the Marines' working memory, Jha found. But those who did their mindfulness homework diligently actually saw a slight increase in working memory capacity. Compared with soldiers who didn't have the training and those who didn't do their homework, mindfulness practitioners also reportered more positive moods and fewer negative moods.

"Their findings really support the idea that you've got to work at it for mindfulness to have this positive impact," Susan Smalley, the director of the Mindful Awareness Research Center at UCLA, told LiveScience. "You not only have to learn it, but you have to practice it."

The research didn't offer a definitive answer as to how mindfulness education changes a person's mood, Smalley said, and more studies are needed to find out if the results can be replicated in larger groups of people. If further research comes to similar conclusions, mindfulness could be used to prepare for typical life stressors, like care-giving for an elderly parent or giving birth.

The results could also benefit other people who require periods of intensive physical, mental and emotional demands on the job, such as firefighters, police officers, other first responders and crisis workers, the researchers say.

"Mindfulness training might be a nice protective addition to our lifestyles," Smalley said.

The research was published in the February issue of the journal Emotion.