New York City will shutter a long-struggling Bronx middle school that has been under threat of state takeover, according to a city plan released Friday, and open a new school in its place.

The plan to close J.H.S. 162 Lola Rodriguez de Tio at the end of the school year allows the city to skirt a state program that would have forced the city to either name an independent manager to run the school or take more dramatic action. An “independent monitor” selected by Chancellor Carmen Fariña and approved by the state education commissioner will oversee the closure.

City officials say they want to open a new school in the building in time for the 2017-18 school year with a dual-language and STEM program, pending state approval.

“This proposed plan is what’s best for the J.H.S. 162 community,” District 7 Superintendent Elisa Alvarez said in a statement, “and I’ll continue to work closely in the coming weeks and months to provide a smooth transition and support students, families and school staff throughout the process.”

The decision is a first step toward clarity for the J.H.S. 162’s teachers and students, who have been waiting to find out how the state’s rules would affect its future. If the plan is approved, many may not return: the school’s current sixth and seventh graders will be able to choose the new school or other nearby options, and teachers will have to compete with others for jobs at the newly created school.

A sudden closure would be a rare move for the de Blasio administration. But the uncertainty that has swirled around J.H.S. 162 this year was a microcosm of the conflict between the city’s approach to improving its struggling schools and a more aggressive approach codified in state law.

Under the state’s 2015 receivership law, schools that had performed poorly on state tests for years were given only a year or two to show academic gains or face the prospect of outside management. The city, meanwhile, has been infusing schools like J.H.S. 162 with extra resources and social services while expecting incremental but steady improvement.

By a couple of measures, J.H.S. 162 was showing signs of improvement. Last year, the school met most of its goals within the city’s “Renewal” turnaround program, and its low English proficiency rates rose from 4 percent to 9 percent. Only 3 percent of its students were proficient in math.

It has also maintained enrollment of roughly 375 students over the past several years, underscoring the unusual nature of the closure. Recently, the city has closed schools immediately when sagging enrollments made them effectively unsustainable.

In recent weeks, there has been little organization at the school to save J.H.S. 162 from closure — neither parent groups nor the school’s principal have spoken out. Even though the city formally submitted its proposal earlier this week, school officials were apparently not part of the decision to close the school, and several parents said there was confusion about the school’s future.

Multiple parents said the school seemed to be making progress. Nelson Santiago, whose daughter attends sixth grade, pointed out that J.H.S. 162 was removed last year from the state’s list of persistently dangerous schools.

But, he said, he was not necessarily opposed to a closure.

“If it’s not up to par, then that means my daughter’s education is not up to par,” he said.

City officials said that parents received phone calls and letters about the plan Friday, and that a town hall meeting was scheduled at the school on Monday at 6 p.m. The proposal must also be approved by the city’s Panel for Education Policy, which will likely vote on the plan in February.