The field trip to Boston’s Museum of Fine Arts was supposed to be a reward for good grades and excellent behavior.

Instead, chaperones say, students from the Helen Y. Davis Leadership Academy Charter Public School in Dorchester, Mass., left in tears last week after they were subjected to racial profiling from museum employees and offensive comments from visitors.

On Wednesday, the renowned art museum issued a public apology to the middle school, where the majority of students are black or Latino. All of the 26 seventh-graders who went on the school trip are students of color, according to school officials, and the allegations have prompted a larger conversation about how museums and other elite cultural institutions can be uncomfortable spaces for people of color.

“The most important data is the fact that we had children leave this museum and adults feeling disrespected because of the color of their skin. That is fundamentally not okay,” Makeeba McCreary, the MFA’s chief of learning and community engagement, told the Boston Globe. “I also know this is not a once-in-a-moment occurrence. People have expressed over time — and I’m from Boston, I grew up here — that the museum is a challenging place to be in the lightest sense of terms, and an unwelcoming place for people of color in the most direct terms. These two things are very true and very real.”

Security guards closely shadowed the seventh-graders throughout their visit and followed them from one gallery to another, Marvelyne Lamy, an English language arts teacher at the charter school, told local media outlets. She and her students noticed that their group seemed to be subject to more scrutiny than predominantly white school groups that were touring the museum at the same time.

“We were instructed not to touch any of the artifacts in the museum, yet the white students there touched the displays several times while security looked on without saying anything,” Lamy wrote in a Monday Facebook post, where she first detailed her frustrations with the museum. “The minute one of our students followed suit, the security guards would yell at them that they should not touch exhibits.”

Meanwhile, a staff member who was explaining the museum’s rules allegedly told the group, “No food, no drink, no watermelon.” Lamy told the Globe that she did not hear the comment herself, but students who were upset by the apparent reference to a well-known racist trope told her about it later on. One 13-year-old told the Globe that the remark left her feeling angry, uncomfortable, and disrespected.

One person who commented on Lamy’s Facebook post disputed the students’ claim, writing that the students misheard and the employee had said, “No water bottles,” WBUR reported. That comment appears to have since been deleted, and it’s unclear whether the individual who posted it had firsthand knowledge of the situation. Though the museum typically allows guests to carry closed water bottles, school groups are advised that no drinks are allowed in the galleries.

The middle schoolers also reported hearing disparaging remarks from other museum visitors. In her Facebook post, Lamy said that one student told her that she had been dancing to music that was being played as part of an exhibit and was told by a museumgoer “that’s it’s a shame that she is not learning and instead stripping.” Another seventh-grade teacher at the school, Taliana Jeune, described the remark differently, telling WCVB that the student had been warned, “I hope you’re paying attention so that you don’t become a stripper.’”

A final interaction hammered home the sense that the students weren’t welcome. Fed up with being followed by security guards, Lamy had decided to cut the field trip short, she wrote on Facebook. The remark about stripping was the last straw, and she told the seventh-graders that they were leaving right away. As they were making their way out of the museum, some students paused by the entrance to an African art exhibit. Ironically, Lamy said, a woman walked by right at that moment and commented, “Never mind, there’s f—ing black kids in the way.”

In her Facebook post, which has been shared more than 1,000 times as of early Friday, Lamy wrote that she never planned to set foot in the museum again.

“We reported all these incidents to the staff at the MFA, and they just looked on with pity,” she wrote. “They took our names and filed a report. Their only solution, they will give us tickets to come back and have a ‘better’ experience. We did not even receive an apology.”

On Wednesday, nearly a week after the field trip, top museum officials apologized in an open letter that acknowledged that the students had “encountered a range of challenging and unacceptable experiences that made them feel unwelcome.”

“That is not who we are or want to be,” the letter said. “Our intention is to set the highest of standards, and we are committed to doing the work that it will take to get there.”

An internal investigation is underway, but museum officials have suggested that regardless of their findings, the fact that the students felt mistreated is cause for concern.

“No matter what the facts show or don’t show, they had an experience that is valid,” Katie Getchell, the MFA’s chief brand officer and deputy director, told reporters on Thursday.

McCreary, the museum’s chief of learning and community engagement, similarly told the Globe, “If they feel they were treated in a way that was racist or unwelcoming, I don’t need to review video. What I’m interested in is that it doesn’t happen again.”

The MFA has made a concerted effort to attract a more diverse audience in recent years. In 2015, the museum found that nearly 80 percent of people who visited were white, which led to targeted outreach and initiatives aimed at making the museum more inclusive. Two years later, Globe reporters who visited on a Saturday found that out of roughly 3,000 guests, only about 4 percent were black.

To some critics, the middle-schoolers’ experience demonstrated why the MFA and other prestigious cultural institutions remain stubbornly white. Racism, wrote Globe opinion columnist Renée Graham, “compels us to self-segregate, to do it to ourselves before it can be done to us. And we tick off the places we won’t go — certain ballparks, restaurants, theaters, symphony halls, hospitals, and stores. And museums.”

“This was a strong group of students that went, they excelled academically,” he said. “The shock of it for them was, ‘We are the top and we carry ourselves the right way as leaders.’ You know, it was very eye-opening for them.

Lamy agreed.

“I had to tell them, you know, as a black or brown person you have to work 10 times harder,” she told reporters on Thursday. “Unfortunately, that’s the world that we live in.”