The principal and four teachers at one of the city’s lowest-performing middle schools spent eight days backpacking through the Colorado Rockies in the name of educational training this past summer — at a cost to taxpayers of nearly $9,000.

After being contacted by The Post, Department of Education officials asked investigators to step in, saying the out-of-state trip was not approved in advance.

The trip from The Urban Assembly School for the Urban Environment in Brooklyn included activities such as rock climbing, rappelling and hiking — at a time when not a single student at the Bedford-Stuyvesant school was able to pass the 2015 state English exam.

It was one of just four schools where no students passed the exam in 2015.

This was also the second year in a row that the school scored a zero in English.

The math results were nothing to boast about, either. Just 12.5 percent of the students passed this year’s state math tests, up from 3.2 percent in 2014.

“The issues raised by this expenditure have nothing to do with the school’s test scores, but any school has to show a clear instructional benefit,” said David Bloomfield, professor of education leadership at Brooklyn College.

“Both Outward Bound [which runs the trips] and Urban Assembly have some explaining to do about questionable procedures and substance.”

Asked about the trip, Department of Education officials said they have referred the case to the special commissioner of investigations because the school’s longtime principal, Kourtney Boyd, failed to get external approval for an out-of-state training expense, as required.

They said that the trip tab of $8,900 was paid for by the school, but that teachers paid for their own flights to and from Denver.

Photos from the trip were posted on Facebook but have been removed.

While the excursion is targeted toward educators — with activities focused on team-building, communication and experiential learning — Boyd said it was designed “to help our teachers transition to a new, more rigorous curriculum this school year.”

It’s not clear what curriculum Boyd was referring to, as the tougher Common Core standards were supposed to be introduced into schools two years ago.

She did not respond to follow-up emails seeking clarification, and would not comment when asked about records suggesting the school’s math teacher is licensed to teach only physical education.

The school, which serves many high-poverty and special-ed students, had an enrollment high of 213 in 2008 under Boyd — when it earned an A on its report card. It has lost so many students since that it served just 57 in 2014-15.

Richard Kahan, CEO of Urban Assembly, said despite the school’s name, it lost its affiliation with the organization in 2009.

Urban Assembly is a non-profit that provides support to small schools.