Officials say a transformer overheated, causing smoke in the gymnasium and a trailer classroom around 5:30 a.m. in the 5100 block of the Black Horse Pike in Mays Landing, New Jersey.
According to fire officials, the transformer got water in it and caused the wires to short out.
The staff who had offices in the gymnasium were temporarily relocated while the building was checked out.
The trailer was empty at the time and had not been used for any activity prior to the fire.
The fire was quickly put under control and there were no reports of any injuries.
The school remained open.