Watch: Ozzy Osbourne's surprise comeback at Birmingham Commonwealth Games
The 73-year-old rocker - who has been diagnosed with degenerative disease Parkinson’s and recently had major spinal surgery - performed the heavy metal band's 1970 hit Paranoid as fireworks exploded around him.
Osbourne told the crowd: "I love you, Birmingham - it's good to be back!"
Joined by members of Black Sabbath - who formed in Birmgham in 1969 - he told the crowd, "Come on, let's go crazy," as the band played the chords to Iron Man.
At the end of the short performance Osbourne said: "Thank you, good night, you are the best, God bless you all - Birmingham forever."
Osbourne - who has not performed live since 2017 when Black Sabbath ended their final tour in Birmingham - is recovering from major surgery to his spine in June.
The rock star had an operation to remove and realign the pins in his neck and back that were inserted following a quad-biking accident in 2003.
He originally injured his spine in a quad-bike accident in 2003. Pins were fitted to realign his back and neck following the injury.
But these were then knocked out of place when he suffered a fall at his Los Angeles home in 2019 and he underwent another operation.
After being plagued by health problems he revealed in an emotional interview with Good Morning America in January 2020 that he had been diagnosed with degenerative disease Parkinson’s, which affects the nervous system and can cause depression.
The European leg of his No More Tours 2 tour — postponed since he fell ill in 2019 — is currently scheduled to go ahead in 2023.
Also performing at the Alexander Stadium to celebrate the culmination of the sporting event were local band Dexy's Midnight Runners, who opened the show with Come On Eileen.