Not once after his right leg shattered in Afghanistan in 2013, during a year of surgeries and the months spent learning to walk on a prosthetic leg, did Sgt. 1st Class Nicholas Lavery consider settling for a medical discharge or ending his Army career behind a desk.

“I never went through a phase like that,” the 35-year-old Green Beret weapons sergeant said. “Within a couple of minutes, I acknowledged the fact that this was my reality.”

By 2015, Lavery was back in Afghanistan, the first special operator to return to combat as an above-the-knee amputee.

“My reasons for staying were the same as the ones I enlisted,” the 6-foot-5 Kingston native said. “I made an oath to protect my country.”

Yesterday, Lavery was inducted into the Military Alumni Hall of Fame at his alma mater, the University of Massachusetts Lowell.

“He is a protector of those who are unable to protect themselves,” said Janine Wert, director of the school’s Office of Veterans Services. “Most of all, Nick is a defender of all of our freedoms.”

As a kid growing up in Boston, Lavery’s favorite pastimes were playing soldier and getting into fistfights, sticking up for other kids.

By the time he was a senior at Boston College High School, he was playing football and planning to enlist in the Army. But college coaches came calling, and he decided to enroll at UMass Lowell, where he studied criminal justice and was an outside linebacker.

After he earned his bachelor’s degree in 2007, Lavery made good on his plans to enlist and joined the elite Special Forces, also known as “the bearded ones” or “the quiet professionals.”

In four combat deployments, he was wounded three times in Afghanistan: first in the shoulder by shrapnel from a rocket-propelled grenade, then by a bullet in the face, and finally by an Afghan police officer who opened fire on Lavery’s crew with a machine gun.

“Instinct kicked in, and I hit the ground,” he said. But when a young soldier with him froze, Lavery said he put himself between the gunman and the teenager and dragged him behind a truck.

Shot once in the left leg and four times in the right, Lavery nearly bled to death in the two hours before he underwent surgery after he was picked up by a helicopter.

His bravery earned him numerous awards, including a Silver Star, a Bronze Star with “V” for valor and three Purple Hearts. But in the two years that followed, he had to prove that he was fit to return to combat.

“My command … felt what I brought to the table superseded my injuries,” Lavery said. “They thought it was a good return on their investment.”

In January, Lavery will deploy again — where, he can’t say. But in the meantime, he’s pursuing his master’s degree at the Chicago School of Professional Psychology and spending time with his wife, Army Master Sgt. Toni Lavery, and their 6-month-old son, Dominic.

Being a dad is “the best thing ever,” Lavery said. “If he decides to go down the road I did, great. But I think it’s something sparked within you. We’ll see if he catches that bug, like I did.”