VANCOUVER, Canada — After dance teacher Adrianne Haslet-Davis lost part of her leg in the Boston Marathon bombing last year, she made a promise to herself that she would perform again. So, Haslet-Davis spent the next year of her life working with Hugh Herr, who outfitted her with a revolutionary prosthetic limb, to relearn the basic dance moves that once came naturally to her.

Onstage at TED in Vancouver Wednesday, she danced publicly for the first time since her amputation. The audience stood on their feet throughout Haslet-Davis' performance, as she sashayed across the stage. Meanwhile, Herr, who was speaking at the conference, stood to Haslet-Davis’ right, out of the spotlight, beaming with pride. Although her performance was short, it was clearly a triumph — her tears were visible from the back row.

See also: 15 TED Talks That Will Change Your Life

“It was perfect,” Herr told Mashable shortly after the performance. “I was very emotional. It was beautiful.”

Adrianne Haslet-Davis wipes away tears after her performance. Hugh Herr stands beside her (left). Image: James Duncan Davidson

Herr, who heads MIT's Biomechatronics research group, met Haslet-Davis a few months after the bombing at a rehabilitation center where he was giving a lecture, and they immediately hit it off.

“I understood her dream to return to dance,” said Herr, who is a double amputee. At age 7, Herr wanted to be the world’s greatest mountain climber; but that dream almost fell apart when he had a climbing accident at age 17, and lost both legs due to severe frostbite.

Like Haslet-Davis, Herr was determined to return to his passion — for him, that was the mountain. So, when Haslet-Davis wanted to dance again, he agreed to make that happen, knowing full well that building a limb that would allow this movement would be one of the toughest challenges of his career.

“It was so new, we’d never looked at something like dance,” he said. “The artificial limb is just a blank slate. If you think it, you can build it.”

Creating an artificial limb for an activity like walking is fairly straightforward because the movement is repetitive. Dance, however, doesn't see the same motions every time.

Herr and his team studied a person of similar size to Haslet-Davis. They tracked points of the subject's body as it moved across a floor made of large sensors that measure things like torque and movement. Using that data, they developed a control algorithm that links sensors on the limb to a motor inside of it — making it function like a spinal cord. In Herr’s words, he “stole from nature” to create a synthetic material that moves like flesh and bone.

Hugh Herr, 49, lost his legs at age 17 after a climbing accident. Image: James Duncan Davidson

Haslet-Davis' dancing limb is just one of the prosthetics she wears today, but it is by far the most revolutionary. She said it allows for tricky footwork and is precise enough to even perform in competition.

“You can have multiple legs for multiple uses,” she said, sitting in the press room after her performance on Wednesday. Still dressed in her white dress made of tassels and rhinestones, Haslet-Davis moved about the room with ease. Herr said because limbs like Haslet-Davis' are made for the individual, it feels natural the second she puts it on — no training required. This was evident in another case that Herr showed during his talk, when a woman began screaming with joy seconds after putting on her new prosthetic.

“The value of carefully modeling normal human function is that when you fit the device to the human, [she] already knows it,” Herr said. “Patients often say ‘I have my body back.’”

But Herr admits that Haslet-Davis still has a long way to go before her limb allows her to return to the daily routine she had before the bombing. For example, Haslet-Davis has to switch out the leg for different activities. Eventually, Herr said, she’d be able to finish her dance and immediately start walking without interruption.

“We’ve taken the first step,” he said. “But by no means is it the last.”