One of the survivors of the Parkland, Florida, school shooting has accused a teacher of leaving 16 students out in hallway during the attack.

Josh Gallagher, a junior at Marjory Stoneman Douglas High School, posted a lengthy note on Twitter detailing his account of the events. He claims he was in teacher Jim Gard's math class when the fire alarm went off. He and other students left the classroom, but soon realized that a shooting was actually happening.

"I walk to the top of the staircase and we heard shots go off," Gallagher wrote. "At this point we all ducked and shock kicked in for half a second of what is happening."

The students then rushed back to Gard's classroom, but they were not let in.

"In an almost instant rush, me and my fellow classmates as well as others rushed back to our classroom," he wrote. "As we made it to the door we found out the door was locked. Which then left me and 15 other students in the hallways ducking as the screams of classmates and gunshots took over the noise around me."

Im a victim of the Marjory Stoneman Douglas shooting. Please read my story below as I present the truth about a teacher Mr. Gard (Jim Gard) who calls himself a hero, and how the media portrayed him as hero when in reality he is the opposite. pic.twitter.com/MH70M6Sqhe — Josh Gallagher (@JoshBGallagher) March 1, 2018

The students then feared for their lives as they did not think they had anywhere to go. Gallagher called his father, a police officer, as he searched for somewhere to hide. Luckily, another teacher stepped up and welcomed the students into their classroom.

"I called my dad up on the phone thinking this could be the last time I speak to him," Gallagher wrote. "As I was on the phone with him as he tried to calm me down, a teacher I never seen before opened [sic] the door for me and 14 other classmates to flee danger. When I got into the classroom I told my dad I loved him, he then said it back to me and he hung up because he was a first responder running into the freshmen building."

He added, "God bless the teacher who opened the door to save us from danger."

Gallagher then made several more accusations about Gard. He claimed he went straight to his classroom without checking for students, called a news station while inside the classroom and later tried to take advantage of the spotlight the media cast on him.

"Hours and days after the shooting I came to found out ... Jim Gard actually ran back into the classroom without turning around and locked his door," Gallagher wrote. "He left 75 percent of his students out in the hallway to be slaughtered."

He continued, "How can a man such as him be viewed as a hero in the media? While the shooting was happening and students were locked in the hall he actually called a news station [to] inform them what was going on instead of attempting or even thinking to save kids he left in the hall!"

At the conclusion of the note, Gallagher did not mince words. He characterized Gard as "selfish" and "a coward."

"He is an opportunist, and people shouldn't value him as close to a hero," Gallagher wrote. "He is a coward. He has re-victimized the students he left out of his class by calling himself a hero. I have nightmares at [what] could have happened because of how selfish and horrific this man is."

Gard admitted that he did not let students students in, but said it was because of protocol. He also claimed the students had stopped trying to get in the classroom before he could get to the door.

“I looked back down the hall and no one was around — no one,” Gard told the Sun-Sentinel. “You have to close the door. That’s protocol. We have no choice. ... I told the kids we can’t let anyone in. We had no idea if it was a drill or not. By the time I walked over to the door, the banging had stopped. I didn’t hear any yelling. If there were 13 kids outside the door screaming and banging, I would have heard them.”

However, another student has corroborated Gallagher's account. Student Connor Dietrich said he was also one of the students who was locked out and said he felt like Gard "left us to die"

"As one of the kids left in the hallway I want people to understand how terrifying and defenseless I personally felt," Dietrich wrote. "The person I had to rely on left us to die, and that’s not okay."

As one of the kids left in the hallway I want people to understand how terrifying and defenseless I personally felt. The person I had to rely on left us to die and that’s not okay. — Connor Dietrich (@CDietrich1007) March 2, 2018

A total of 17 people were killed during the attack. The confessed gunman behind the mass shooting, Nikolas Cruz, is expected to plead guilty to all charges levied against him.