Follow CBSMIAMI.COM: Facebook | Twitter

PARKLAND (CBSMiami) – A student, stuck in a classroom as the suspected shooter fired into the halls at Marjory Stoneman Douglas High School is crediting a teacher for saving his life and the lives of his classmates.

READ MORE: Miami Woman Accused Of Operating 4 Massage Parlors As Fronts For Prostitution

His name is Scott Biegel and he is one of the 17 victims killed in Wednesday’s shooting.

On Friday, student Moises Cobo spoke to CBS4’s Carey Codd about the heroism of his teacher, the frightening moments he heard the shooter screaming and how he and others can move forward from this.

Cobo left his 3rd floor Geography class at Marjory Stoneman Douglas High School when he heard a fire alarm on Wednesday afternoon.

Once he got into the stairwell in the freshman building, he heard gunshots.

“My reaction was going back to the classroom and telling Mr. Biegel there’s gunshots on the first floor,” said Moises.

Moises is convinced that what teacher Scott Biegel did next saved his life and the lives of more than a dozen others.

“He opened the door and waited for everybody to get in,” said Moises. “Instead of him going first, he waited for every last person to get into the classroom.”

And as the last student entered, Biegel was shot and killed.

“After my last friend got in the classroom, he fell,” said Biegel.

Moises and the other students hid in the classroom praying, whispering and listening to the accused shooter Nikolas Cruz roam the hall screaming.

“We heard him, ‘open the doors. open the doors.’ He was like, ‘Come on, open the doors!’ And screaming, “No, no, no,” said Moises.

READ MORE: London-Bound American Airlines Flight Returned To MIA After Couple Refused To Wear Masks

Moises sent a text in Spanish to his mother saying, “Mom, I love you all. It’s Moises. I love you. I love you. I will not forget you Mom.”

On Wednesday, Codd spoke with his mother right after she spoke with her son.

“Mom I am fine but my teacher died for us,” said his mom.

During the minutes of terror, the door to his classroom was open. Moises believes the gunman didn’t enter because he might have thought Biegel was by himself.

“I was getting ready for the worst. It’s a miracle that he didn’t get in,” said Moises.

Soon, law enforcement arrived. After he was rescued Moises wanted to know about his sister’s school – West Glades Middle right next door.

“I felt like if she’s ok, everything’s fine. It didn’t matter what happened to me, I was just wondering if my sister’s ok,” said Moises.

She was okay and now Moises and his dad are forever indebted to Scott Biegel.

“He saved all of our lives and I’m never gonna be able to repay what he did for us,” said Moises.

Moises is convinced that Biegel is in a good place because of the last message he shared with his students before they heard the fateful fire alarm.

“The last lesson that he gave us on that day was about religion and he was explaining to us that all religions mean the same thing — if you live a good life, you go to heaven. What a coincidence,” said Moises.

Moises is sure that Scott Biegel lived a good life and is in heaven.

MORE NEWS: COVID-19 Testing Site Finder

Moises said he’s not sure how anyone that attends or works at Marjory Stoneman Douglas High will be emotionally ready to return to school but he said the thought that will be on his mind when that day comes is honoring Scott Beigel and the other teachers, students and staff who lost their lives here.