Haberdashers' Borough Academy is now established in its permanent home at the former London Fire Brigade training centre in Southwark Bridge Road.
The school first opened in 2019 in temporary accommodation whilst construction work continued.
The academy now has almost 900 pupils across years 7 to 11 and will have pupils sitting GCSEs for the first time this academic year.
"We were thrilled to welcome the Duke of Edinburgh to officially open Borough Academy," said principal Declan Jones.
"It was wonderful to showcase our facilities and to see our students engage with HRH so enthusiastically. I am proud to see how this school has developed from initial plans to one that is now at the heart of its community and offers a truly special pupil experience."
Originally known as Haberdashers' Aske's Borough Academy, the school changed its name in 2021 after controversy over benefactor Robert Aske's links to the slave trade.
The Mayor of Southwark, Cllr Michael Situ, shared some photos of the occasion on X: