It was a nail-biter of a vote. But in the end, a frantic attempt to keep the doors open at Washington Metropolitan Opportunity Academy failed to get the ­supermajority of D.C. Council support needed.

Seven of 12 council members backed the emergency legislation, falling one vote shy of the necessary two-thirds.

The contentious vote arrived less than two weeks after Mayor Muriel E. Bowser (D) and D.C. Public Schools Chancellor Lewis D. Ferebee announced they would close Washington Metropolitan — an alternative middle and high school that serves students who struggled on traditional campuses.

The school — known as Washington Met — would be the first campus in the traditional school system to close since 2013.

The tight vote highlighted the education philosophy of a council faction that has become increasingly vocal in its support of the traditional public school system, wary of closing campuses in the system. If the legislation to save the campus had passed, it would have served as a major blow to Bowser and Ferebee’s education leadership, challenging the mayor’s control of schools.

“We have hired someone, an expert in this field — Chancellor Ferebee — to make these decisions,” said council member David Grosso (I-At Large), who chairs the education committee and voted against the proposal. “If we don’t trust him, then why bother? Why bother even having mayoral control [of schools] at all?”

Council member Robert C. White Jr. (D-At Large) introduced the legislation on an emergency basis, which means it needed eight votes to pass.

Ferebee has cited declining enrollment, dismal attendance, dilapidated facilities and lackluster academic results as reasons for closing the school. He said the school’s students would be better served at other campuses.

But White said the school system failed to properly invest in the school and is using poor academic outcomes as a basis for closure. He said extracurriculars and support staff have been slashed at the school in recent years. He wants the city to invest in Washington Met, giving students a chance to succeed.

“There is a deliberate disinvestment in the school,” White said. “What is our role here? Is our role to do nothing and let them make up these statistics? Let them not invest in these students who need it the most?”

Many council members said they were not convinced Ferebee had a detailed plan to ensure students smoothly transition to other campuses.

The school system said it has already met with 73 of Washington Met’s 142 students about their future education plans.

“The Bowser administration is focused on supporting students during the transition and ensuring they receive all necessary supports to be successful this year and into the future,” Deputy Mayor for Education Paul Kihn said in a statement.

The council members in favor of the emergency measure painted a dire picture of what could happen to students if the school closes at the end of the academic year.

Council member Mary M. Cheh (D-Ward 3) warned that students would simply drop out. Trayon White Sr. (D-Ward 8) said he feared some would leave school and end up dead.

Others said that the school serves many students who are entangled with the justice system and that they worry closure would set them on the wrong path.

“Let’s not put these young people on a path to go to jail,” Vincent C. Gray (D-Ward 7) said. “And I’m afraid that’s what is going to happen.”

A handful of Washington Met students attended Tuesday’s council meeting, receiving unexcused absences so they could attempt to sway council members ahead of the vote.

The students said that their stomachs churned before the council meeting and that they hoped council members would send a signal they care about the fate of students who have struggled in mainstream classrooms.

“There are kids here that need Washington Met,” said Angel Johnson, a senior who cycled through two high schools and a job-training program before landing at Met. “It’s a home.”

As the students sat through the council’s discussion about the future of their school, the debate turned tense when Council Chairman Phil Mendelson (D), who voted against the proposal, said Washington Met “is not a school to be proud of.” Council member Charles Allen (D-Ward 6), who supported the measure, jumped in and said the council was proud of the students.

Those in support of closing the school said it was unfair to allow students to remain at a struggling campus. Anita Bonds (D-At Large), who voted against the measure, said she did not have enough information to vote to reverse the mayor.

“I think we are being emotional about it,” Bonds said. “We haven’t had a full discussion of what is going to happen to these students.”