Students at a Missouri high school hoisted the Confederate battle flag in their school lunchroom to protest classmates who handed out rainbow pride flags in support of LGBTQ rights.

»MORE: Nikki Haley says Confederate flag about 'sacrifice, heritage' before Dylann Roof 'hijacked' it

The incident, which happened Dec. 9 at West Plains High School, ended when teachers intervened and took away the rebel flag, according to reports.

Students who had the smaller-sized rainbow flags attached to their backpacks were told to put them away. No additional disciplinary action was taken.

‘A learning experience’

In a statement, the school said it was treating the episode as a teachable moment.

“Rather than deal with this as a disciplinary matter, we chose to deal with it as a learning experience,” a school spokesperson wrote. “Our hope is to teach our students to respect each other and to respect different viewpoints on a variety of societal issues.”

The school district acknowledged that the Confederate and rainbow flags were allegedly “used by some members of the groups to taunt other students.”

»FROM 2018: New poll shows declining support for Confederate battle flag

The controversy has sparked widespread debate on social media about freedom of speech and bullying.

Reports say two or three male students who were unidentified held up the rebel flag in the senior area of the lunchroom.

In photos of the incident, the students can be seen holding up the large rebel flag.

Students at West Plains High School in Missouri are shown holding up a Civil War Confederate battle flag last week in response to classmates handing out rainbow flags.

Credit: Photo courtesy of Twitter

icon to expand image

Credit: Photo courtesy of Twitter

Social media posts about the incident were widely shared and contained pointed, anti-gay sentiments.

One student’s post read: “If they can fly their queer flags, others can fly their rebel flags — Butt hurt?”

Another student posted: "I think it is a problem that we have an entire month dedicated to someone's sexuality and only a day for veterans. You have the right to fly your LGBTQ flag just like I have the right to fly my American and/or rebel flag."

‘Just like retaliation’

The two students who distributed the LGBTQ flags said they didn't mean to offend anyone.

One of the students said she helped order 60 of the small banners to show solidarity with gay students who may have unsupportive parents, showing “that they’re not alone.”

»MORE: Confederate group sues Georgia city about rebel flag removal

Rose Schilmoeller, a 15-year-old sophomore, accused the rebel flag students of using “anti-gay slurs against her and her friends,” according to West Plains NBC affiliate KY3.

“To us, it was just like retaliation to people who were holding their own [pride] flags,” she told the station in an interview. “The worst part is that others were backing them up.”

The situation reportedly became uncomfortable enough that some students left the cafeteria and called their parents to take them home.

“The main point in this story isn't even the flags — it's the immense bullying issue," Rose said.

»FROM 2018: Confederate flag displayed at annual Alpharetta event

The Confederate battle flag, featuring a diagonal blue cross with stars, is widely seen by minority groups as a potent symbol of slavery and white supremacy in America.

Designed by Southern secessionist William Porcher Miles in 1860, it was first flown as the Civil War battle flag of Gen. Robert E. Lee's Army of Northern Virginia.

William Porcher Miles, designer of the Confederate battle flag

Credit: undefined

icon to expand image

Credit: undefined

The flag has since become the most widely recognized symbol of the Confederacy.

The battle flag, however, was never adopted by the Confederate Congress, never flew over any state capitols during the Confederacy and was never officially used by Confederate veterans groups.

A Channel 2 investigation shows Confederate symbols have a powerful significance for some groups in Georgia, including the alt-right, but those groups say it's not a racist symbol.

The flag was resurrected by the resurgent Ku Klux Klan and used by Southern Dixiecrats during the 1948 presidential election. Organizations such as the Sons of Confederate Veterans have also adopted the flag as a symbol of Southern heritage.

The Georgia angle 

On Feb. 13, 1956, the Georgia state flag was changed to incorporate the Confederate battle emblem into the design as a response to the Supreme Court ruling on school desegregation.

In the late 1980s, black state legislators pushed to drop the state flag with the Confederate battle emblem and restore its predecessor, but failed.

»MORE: A history of Georgia's state flag

In 1994, James Coleman of Atlanta filed suit against then-Gov. Zell Miller and the state of Georgia over the state flag. Miller had said he wanted the Confederate emblem removed, but lawmakers wouldn't pass such legislation and the matter was dropped.

»PHOTOS: Confederate flag rally at Stone Mountain Park

The Georgia Legislature next approved a new flag in 2001 and again in 2003.

Georgia voters approved the current flag design in a March 2004 referendum.