The first grenade bounced off the hood of Glen Lehman's Humvee as it patrolled the streets of Baghdad. But the second grenade tore through the door, shredding Lehman's thigh and filleting his arm.

Lehman survived, thanks to his quick-thinking comrades and a helicopter evacuation to a nearby air base for emergency medical care. But a new battle was just beginning for the sergeant first class and father of two, who fought excruciating phantom limb pain where his right arm used to be.

"It felt like my hand kept getting slammed in a car door," said Lehman, 34, whose right arm was amputated above the elbow.

On top of the pain, Lehman struggled to control his prosthetic arm, which ended with a pincer in place of a hand.

"It was hard to even get the prosthetic in the right position," he said, describing how the cumbersome limb turned simple tasks into impossible missions. "I could move the elbow, wrist or hand but only one at a time and in that order. If the elbow was in the wrong position, and I was using the wrist, I had to remember to switch from wrist to hand and then to elbow before I could reposition."

Suddenly, the soldier who once led his platoon was unable to make his sons' peanut-butter-and-jelly sandwiches.

With TMR, surgeons reroute the nerve stumps left over after an amputation to muscles in the chest and upper arm so they can control a prosthetic arm by simply imagining the movement.

"I didn't know what to expect," said Lehman, recalling the decision to undergo the experimental operation. "But I wasn't really worried about any drawbacks at the time."

Lehman's severed nerves sent shooting pain through his phantom limb. The white, rubbery fibers, about the thickness of a pinky finger, continued to carry messages from his brain but had nowhere to send them. Dumanian gave these fibers a new purpose, stitching them to smaller nerves so that the electrical signals they carried could be used to control a bionic arm. But reconnecting the nerves was just the beginning.

"When we want to use our hands, we don't think, 'OK, I'm going to move my elbow, then my shoulder and then my hand.' No, we just think about it and it goes," Dumanian said. And achieving this level of intuitive control is where the science gets closer to science fiction.

Lehman was one of the first amputees to use groundbreaking pattern recognition technology to control his prosthetic arm. It works like speech recognition, according to its creator, neural engineer Levi Hargrove, and relies on a tiny computer the size of a quarter in the bionic arm.

"When we first worked with Glen, we taught him that he needs to think of making repeatable patterns," said Hargrove, director of the Neural Engineering for Prosthetics and Orthotics Laboratory at the Rehabilitation Institute of Chicago. "Next, we taught the computer what those patterns look like."

Over time, the computer learned to translate Lehman's thoughts into coordinated movements at multiple joints.