A chapter in the city teachers union’s awkward foray into the charter-school movement is ending.

The United Federation of Teachers announced Friday that the UFT Charter School will close its elementary and middle schools at the end of the year because of their low performance. The union will ask to hold onto its authority to operate the school’s high school grades.

The move, while not unexpected, is an embarrassing one for the union. When the school opened in 2005, then-UFT President Randi Weingarten said its success would demonstrate that unions could play a starring role in efforts to improve the school system and show that a union contract was not the “impediment to success” that education leaders like then-Chancellor Joel Klein portrayed it to be.

But the East New York school, which grew to serve students from kindergarten through twelfth grade, struggled early and never found its footing. It was one of the lowest-performing charter schools in the city over the last few years, and faced years of organizational dysfunction and financial distress, according to SUNY reports.

On Friday, the union acknowledged that its elementary and middle school grades had not met the standards set by its authorizer, the State University of New York.

In a statement, UFT President Michael Mulgrew took a parting shot at SUNY, saying its standards for renewal are too focused on state test scores. But the school has struggled on other measures, too. Under Chancellor Carmen Fariña’s new school-grading system, the school earned the lowest of four marks in all four categories, including the school environment and its success at closing the achievement gap.

The high school has performed significantly better: 44 of 50 students graduated on time last year, according to the city’s graduation rates.

A phone call to UFT’s elementary and middle schools was not answered on Friday.

The UFT’s move to give up its lower grades saves the school leadership from going through a public renewal fight. The school was essentially out of options after receiving a two-year renewal in 2013 on the condition that its academic performance improved by 2015. “I don’t want to have another round of this,” Joseph Belluck, chair of SUNY’s Charter Schools Committee, said then.

A spokeswoman for SUNY said that it would release an analysis of the school’s performance Monday. SUNY’s Board of Trustees are expected to vote on renewals for several charter schools, including UFT, on March 6.

The school had already earned one probationary renewal, but was given an extra chance after school leadership argued that bringing its elementary and middle school grades under one roof would spur improvement. That move required a controversial co-location, in another instance of the school prompting the union — a consistent opponent of charter school space-sharing during the Bloomberg years — to depart from its typical positions.

Closure of the UFT Charter school’s lower grades, which the union says enroll about 670 students and 50 teachers, would happen at the end of the year. The education department will work with families at the school to place students in new schools for next year, the union said.

Low-performing schools are facing growing scrutiny as they come up for renewal, as more than one in four charter schools in New York will this year, according to New York City Charter School Center CEO James Merriman.

Closures are rare, but the UFT Charter School is the second New York City charter school that SUNY will move to close this year. The Board of Regents, which gives final approval to charter-school decisions statewide, told the city recently that it needed to take a stricter approach to charter-school oversight.

The UFT serves as the collective bargaining unit for 21 charter schools, including the University Prep Charter High School, where Weingarten, now the head of the American Federation of Teachers, is still a board member. But the vast majority of the UFT’s 110,000 members work in district schools, and many remain deeply critical of the sector.

The feeling is mutual. Merriman said in a statement that he was “not surprised – but still dismayed” that the union “would not accept even the slightest responsibility for its abysmal failure to provide children with a great education.”