The nation’s oldest public school – and the alma mater of five signers of the Declaration of Independence – is embroiled in a racial controversy that may be its biggest test in nearly 400 years.

Boston Latin School, founded in 1635 and still one of America’s most prestigious high schools, has undergone an administrative shakeup, faces growing demands from community leaders and is the subject of a federal investigation. The controversy arose after two black students claimed on YouTube that racism courses through hallways and classrooms, and the administration turns a blind eye.

“The fact that our administration failed to publicly denounce this behavior, or even say something to the students making the comments that was effective, has created an unsafe and racially hostile learning environment for students of color at B.L.S.,” recent graduates Meggie Noel and Kylie Webster-Cazeau, members of a group called “Black Leaders Aspiring for Change and Knowledge,” said on the video.

The video sparked investigations by the school district and the U.S. Attorney’s Office, as well as an ever-louder chorus of demands for resignations and reforms from civil rights groups. Faculty members have blamed Schools Superintendent Tommy Chang and Boston Mayor Marty Walsh for refusing to defend the administration.

Last week, Headmaster Lynne Mooney Teta and Assistant Headmaster Michael Flynn, who worked at the school for more than half a century, resigned.

“This has been a very difficult decision, but one which I believe is in the best interest of our students, faculty and our historic institution,” Teta, who served as headmaster for nine years, said in a statement. “I believe that it is time for a new headmaster to lead the school and carry on the tradition of excellence.”

Their ousters were seen in some quarters as a cowardly sacrifice to an angry mob and in others as a necessary first step toward reclaiming the vaunted reputation of a school that has long purported to be a color-blind “escalator of upward mobility” for Boston’s poor and middle-class kids. Incidents involving alleged racism have occurred, but hard evidence that it is systemic or tolerated by the administration is elusive.

The school district investigation prompted by the video probed seven alleged incidents involving students or faculty and found all but one were handled appropriately by Teta’s staff. That case involved a boy who allegedly called a black girl a racial slur and threatened to lynch her while holding up an electrical cord. Investigators say Teta failed to inform the parents of both students. Teta says the white student was disciplined but details are kept confidential.

The president of the NAACP's Boston chapter, Michael Curry, said Teta should have called the police and should have been fired for not doing so.

Another black student says during a class discussion of racism in "Huckleberry Finn," her white teacher came up to her and asked, "what's up, my n----r?" The girl's mother says Teta called in district investigators who found the teacher's language "inappropriate," but not grounds for discipline.

Curry says the same girl was mistreated a second time, when the school called police to the building, after she wrote online she felt like "shooting" a teacher. The student was suspended for 10 days, a penalty Curry likened to "criminalizing" black student misconduct.

Many Boston Latin faculty members and students -- including some minorities -- backed Teta and accused civil rights activists of fanning the flames of community anger.

African-American math teacher Trevour Smith, 29, said he didn’t want Teta to quit, but added that racial tension in the school is real. Now, he sees his colleagues circling the wagons around the administration, instead of trying to learn from the criticism. If administrators suddenly feel "unsupported," Smith said, "now they know how a minority person feels."

This week, Chang named Michael Contompasis, a Boston Latin graduate who served as headmaster for 21 years, the interim headmaster.

"I understand firsthand that we all have a duty to preserve Boston Latin's mission of providing the very best quality of public education,” Contompasis said in a statement. “That includes making sure all of our students, faculty and staff feel safe and supported."

Flynn, the assistant headmaster who wrote an angry letter to Chang in which he blasted the superintendent for allowing the school’s reputation to be assailed, said the administration's response wasn't perfect, but "we did good things."

In the end, Flynn said, he couldn't fight "lies."