A San Antonio Marine who lost his leg in Afghanistan crossed the finish line of the Boston Marathon on Monday the same way he had run most of the course -- with a U.S. flag in hand.

Retired U.S. Marine Jose Luis Sanchez waved the flag, which had been signed by fellow Marines, most of the 26.2 miles.

In 2011, Sanchez lost the lower part of his leg when he stepped on an IED in Afghanistan, according to the Boston Globe.

Sanchez "couldn't wait" to get back into physical shape, and when walking wasn't enough he started working out intensely, he told the Globe.

"I was like I'm not gonna let this beat me, dude. I used that to fuel my drive," he said. "Never again am I going to feel sorry or feel these emotions. I'm not gonna feel weak anymore. At that point, I never looked back."

Sanchez's unit wrote him messages on the flag, which was flown at every location during their tour, he told WBZ-TV.

Sanchez was fighting post-traumatic stress disorder when he decided to open the flag and read it five years after the unit had given it to him, he said.

"Then instead of putting it away, I wanted to fly flag the flag again in their honor, for everyone’s sacrifices," Sanchez told the station. "It wasn’t for me; it’s for everyone that’s here fighting day in and day out."

He ran Monday with Team Semper Fi, a nonprofit organization that helps service members who are dealing with life-changing injuries, post-traumatic stress or critical illness, according to the Globe.

"It’s for others to be inspired, to be motivated," Sanchez said. "I don't do it for myself, I do it for others. We live for others."

He finished the marathon in 05:46:13.