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

The principal of a D.C. elementary school apologized after an in-class assignment ended with a black fifth-grade student being asked to portray a slave and another being asked to pretend they were drinking from a segregated water fountain.

The incident happened at Lafayette Elementary School during a social studies lesson on the Civil War and Reconstruction. In a letter to parents, a team of teachers at the school said students were told to separate into smaller groups and create either a podcast or a dramatic reading.

It was during this group activity that some black students were asked by their fellow classmates "to play roles that are inappropriate and harmful," the letter, obtained by NBC News, read.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

The teachers said the Civil War unit is taught to fifth-graders every year and they have always tried to be mindful that the lesson contains "a very tough part of our U.S. History."

"We deeply regret that we did not foresee this as a potential challenge in role playing so we could set appropriate parameters to protect students," the letter stated.

The school's principal, Carrie Broquard, said in a separate letter that the assignment was a mistake and will not be given to future classes.

Lafayette Elementary School in Washington, D.C. Google Maps

"At Lafayette, we believe in the importance of teaching painful history with sensitivity and social awareness. Unfortunately we fell short of those values in a recent 5th grade lesson," she said.

Broquard said the school plans to create a Diversity and Inclusion Committee and also has teams working to ensure "all assignments are culturally sensitive and appropriate." In January, the entire staff will have diversity training, she said.

"As the leader of the Lafayette school community, I am distressed this happened and saddened our students were hurt," the principal's letter read.

Several schools have come under fire recently for similar incidents. Earlier this month, a teacher at Blades Elementary School in St. Louis, Missouri, was placed on administrative leave for giving students an assignment that asked them to "set your price for a slave."

In March, a private school in Bronxville, New York, held mock slave auctions in which a fifth-grade teacher urged white students to bid on black classmates. The state Attorney General's Office launched a probe into the incidents at The Chapel School, and the school agreed to diversify its staff and student body. The school also had to agree to hire a chief diversity officer.