A middle school teacher on Long Island is under investigation for allegedly asking students to "write something funny" about pictures of slavery as part of a class assignment.

The eighth grade students at John W. Dodd Middle School in Freeport, New York, were apparently asked to write the "funny" titles and captions for a series of black-and-white photos of slaves in cotton fields.

The assignment was widely condemned on Facebook after Darlene McCurty, a student's grandmother, uploaded images of the worksheets with such captions as "black girls work hard play hard" and "Us black people need to get out" written beneath them. One image on a worksheet McCurty uploaded is titled "Black girl magic" and another is headlined "Getting that money."

McCurty wrote in a Sept. 20 Facebook post that she was contacted by her granddaughter, who was disturbed by the assignment given to a friend of hers. The post has been shared more than a thousand times. McCurty could not immediately be reached for comment.

Dr. Kishore Kuncham, superintendent of Freeport Public Schools, addressed the assignment in a statement Sunday.

"I have been informed that during a recent eighth grade Reconstruction Era social studies lesson at J.W. Dodd Middle School, a faculty member is reported to have used directions to describe an assignment that were very upsetting to some students and families," Kuncham said. "The emotional and social wellness of our students is always our highest priority and we take any insensitive comments made by staff very seriously."

Kuncham said he has directed that an investigation of these claims be immediately conducted.

A spokesman for the school district declined to comment Monday on whether the teacher behind the assignment was still working while the investigation is being conducted. The spokesman referred NBC News to the superintendent's message posted on the district's website.

McCurty's granddaughter told her that the social studies teacher, who she said is white, instructed students to make their comments "really funny because she didn't want to be bored," according to the Sept. 20 Facebook post.

J.W. Dodd Middle School is made up of seventh and eighth grade students, and as of the 2017-18 school year, its student body was 66 percent Hispanic and 25 percent African American, according to the New York State Education Department.

In May, the New York State Attorney General's Office announced its findings in a probe into incidents at The Chapel School, a private school in Bronxville, New York, where a teacher held mock slave auctions in two separate fifth-grade social studies classes in March.

"The investigation found that the teacher’s re-enactments in the two classes had a profoundly negative effect on all of the students present — especially the African American students — and the school community at large," state Attorney General Letitia James said in a statement at the time. "Following the re-enactments, the school terminated the teacher’s employment."