The Earl of Wessex laughed and joked with the students and enjoyed a performance by the academy's jazz band before thanking the staff and pupils for their enthusiastic welcome.
The prince was also given a tour of the new building before the formal ceremony where he unveiled a plaque.
However, the Earl's visit got off to an inauspicious start when his helicopter was unable to land in the playing field outside Abraham Darby Academy in Madeley because of the wet and windy weather.
He had to divert to RAF Shawbury and travel to the school by car.
In a brief reference to the Queen's Diamond Jubilee celebrations he told students: "I'm slightly overdressed for the occasion.
"I don't normally dress like this when I'm visiting a school, but I'm visiting the National Memorial Arboretum in Staffordshire this afternoon to unveil a new Royal Fleet Auxiliary Association Memorial.
"Actually, this is the second time this uniform is going to get a real soaking, and no prizes for guessing when the first occasion was."
On his arrival at the £25 million school, the Earl was greeted by children from the neighbouring Woodlands Primary School, who presented him with a bouquet of flowers.
Vanessa Bradley-Ammari, school business manager at Woodlands, said: "It's so nice to see Prince Edward at the school. He stopped and talked to the children and they were really excited."
As the Earl made his way into the foyer of the new academy he was greeted with a fanfare by some of the school's musicians while pupils lined the staircases and leaned over the balconies on the upper floors to catch a glimpse of their royal visitor.
The Earl appeared to enjoy the music, and waved to the youngsters as they cheered his arrival.
After being introduced to the school's principal Steve Hawke, Prince Edward was given a short guided tour of the building by head girl Jennifer Rogers and head boy Sam Maullin.
Jennifer, 17, said the Earl had been especially interested in the school's music facilities.
She said: "He seemed very interested in my musical things. We were talking about the school band's trip to New York that's coming up, and he seemed really interested and enthusiastic about the bands and music."
Sam, 17. said the Earl also shared his memories of being head boy at Gordonstoun School in Scotland.
"He asked how I thought the school had changed since moving here, and told me that he'd been head boy at his school," he said.
"He said our school was such a special school, he hinted he'd have loved to be at a school like this."
Following the tour, the Earl made his way to the school's main auditorium where he was invited to unveil a plaque to officially open the new building.
He said: "The unveiling of a plaque of a plaque is not necessarily the most exciting thing in your lives, but when I unveil this it will mean that the academy is well and truly open."
Before he left, Lois Adams, 13, and David Stephens, 14, presented their royal guest with an Abraham Darby rose.
"It was quite nervewracking," Lois said. "It was so important. It was a thank you from the staff and students for opening our new academy."
The Earl was also given a CD and a DVD of the Abraham Darby Jazz Band, which performed before the ceremony.
He appeared to enjoy the music, tapping his thumbs to the beat and applauding loudly at the end of the performance.
Mr Hawke said he was proud of the staff and students at the Academy, which he said made his job easy because of their dedication.
"The most impressive things about Abraham Darby is the students," he said.
"They are the most amazing young people and we have an amazing building now."
By Pam Griffin