Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Maryland school district is investigating why a Nazi flag was hanging in a classroom window over the weekend, where it was "clearly visible" to people attending a basketball game, school officials said.

The district removed the flag immediately after it was notified of it, Frederick County Public Schools said in a statement.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The district said it would conduct an internal investigation and "take appropriate steps to ensure an incident such as this is not repeated."

"The values of FCPS are in direct contrast to the message represented by that flag, and we apologize that the display of this flag caused hurt in our community," the statement said.

Download the NBC News app for breaking news

The flag was hung during a World War II history class at Governor Thomas Johnson High School in Frederick, northeast of Baltimore, the district said.

On Saturday, a person who identified herself as a graduate of the district posted a photo of the flag on Facebook. She said it was seen during one of the most important sports events in the district — a basketball game Friday night between Thomas Johnson and Frederick high schools.

"What culturally proficient educator has a 'life' size Nazi flag in their tool kit and then has the audacity to hang it OVER THEIR CLASSROOM WINDOW IN THE FRONT OF THE SCHOOL BUILDING BY THE MAIN ENTRANCE," the poster wrote on Facebook along with the image.

The flag represented "irresponsibility and privilege at its highest levels," she wrote.