Brune Park Community School, in Military Road, was seriously damaged by the blaze, which ignited shortly before 5.53pm.
More than 40 firefighters from across the county were mobilised to tackle fire, which took hold in a recently-closed building at Brune Park.
In all, emergency personnel used 17 breathing apparatus sets and two main jets to finally quell the flames, which are understood to have ignited on a flat roof on the first floor.
A spokeswoman for Hampshire and Isle of Wight Fire and Rescue Service said approximately 10 per cent of the building had been destroyed.
Officers managed to extinguish the blaze by 9.25pm.
Dozens of people outside the school’s boundaries looked on as the flames were quenched.
Among them was Year 7 pupil Ella-Mai Mcintosh-Sayles from Rowner.
Speaking to The News with the permission of her mother, the 12-year-old said: ‘I just couldn’t believe it, it was actually pretty crazy to see my own school on fire. The whole building was surrounded by firefighters.
‘There were seven fire engines and four police cars. We saw the building was on fire and we could flames coming out the roof, walls and windows.
‘I could see firefighters that were climbing in and out of a broken window making sure nobody was in the building.’
The cause of the blaze is not yet known, but a spokesman from Hampshire Constabulary said they are investigating and treating the incident as suspicious.
Firefighters carried out a further inspection of the derelict building at 7am, with no further action being taken.
The school is set to reopen on Monday, and a spokesman from Gosport and Fareham Multi Academy Trust said it was due to the rapid response of the firefighters.
He added: ‘We would like to say a huge thank you to emergency services who responded to the fire at Brune Park Community School.
‘It was their swift action that ensure the fire was quickly brought under control, preventing a more serious situation and further damage to the building.’