A teacher at a Florida high school where 17 people were killed in a mass shooting is under fire for allegedly comparing a student to Adolf Hitler after the teen posted a photo of himself holding an assault rifle at the gun range.

Kyle Kashuv, a junior at Marjory Stoneman Douglas High School in Parkland, took to Twitter on Wednesday to call out the teacher, Gregory Pittman.

'So... I just got a call from a friend of mine from (Pittman's) class and he apparently compared me to Hitler in class and said I am a piece of crap,' Kashuv tweeted.

Kyle Kashuv, a junior at Marjory Stoneman Douglas high school in Florida, was allegedly compared to Hitler by a teacher after he posted this photo of him holding an assault rifle at a shooting range

Kashuv said in a tweet that that Gregory Pittman, a history teacher, made the comments during a class

Officials at Marjory Stoneman said they were investigating Pittman's alleged comments. Pittman is pictured at the Walk for Solidarity at North Community Park in Parkland on March 10, 2018

'I find it utterly vile that he'd call a Jew the next Hitler,' he said in another tweet. 'It's also quite telling that he doesn't know that Hitler took the people's weaponry and I want more law-abiding citizens to have firearms.'

A student in the class told Fox News that Pittman's alleged comments were made during a discussion in class over Twitter photos and videos Kashuv posted on Friday of him at the shooting range with his father, a veteran of the Israel Defense Forces.

The student said the teacher's alleged remarks were 'basically a hate fest'.

'They were just saying mean things about Kyle. He talked about how he was right, and how Kyle was making an a** of himself. He did say he 'was the Hitler type.' I don’t really know what that means exactly, but I think he was just being crazy,' the student said.

Pittman is also accused of calling Kashuv 'dangerous'.

The history teacher's alleged comments during the class, which Kashuv was not present for, led to an internal investigation at the school, Fox reports.

'School leaders take all matters involving students and staff seriously,' Broward County Public Schools spokeswoman Nadine Drew said in a statement. 'They are aware of the allegations and are looking into the matter.

According to the Sun Sentinel, this was not the first time Pittman was criticized for comments he made about the teen.

On Friday, Pittman posted several tweets slamming Kashuv for posting the gun range photos after 17 students and staff members at Marjory Stoneman were killed by gunman Nikolas Cruz in February.

'After a mass shooting you don’t have to be the sharpest tack in the box to understand when another student posts a photo of an assault weapon why school security personnel and police might ask questions.'

Kashuv, who supports the second amendment, was at the shooting range with his father

Pittman said in a tweet Friday that he didn't think it was a good idea for Kashuv to post the videos and photo after 17 people were killed at their school

In another tweet he added: 'Probably not the brightest idea to hold it like that or anyway to post on social media by a student from a school that just had a mass shooting except to get attention to gain followers and create PR. Also I own 2 guns, but don’t need to post them on social media.'

In one picture, the 16-year-old Second Amendment supporter is seen holding an AR-15 assault rifle in front of a target riddled with bullet holes.

'It was great learning about our inalienable right of #2A and how to properly use a gun. This was my first time ever touching a gun and it made me appreciate the #Constitution even more. My instructor was very informative; I learnt a lot. #2A is important and we need 2 preserve 2A,' Kashuv wrote in the caption.

He also posted videos of his instructor showing him how to handle the gun and of himself firing at a target.

Kashuv said in a tweet later that he had been reported to school officials over his social media posts and was interviewed by school police and received a report from the Broward County Sheriff’s Office.