The authorities did not disclose the cause for the fire but said there were no casualties and they stopped the train services.
Five people were taken to a nearby hospital and some 16 medical teams rushed to the scene where firefighters started to tackle the blaze.
The fire erupted at 12:35 p.m. according to the Haramain High-Speed Railway’s Twitter account.
Security aviation had intervened to support the estimated 26 firefighting teams of the Saudi Civil Defense in fighting the fire.
Dramatic videos on social media showed teams using helicopters in an attempt to put out the fire, which sent huge palls of smoke into the sky of the coastal city.
As the first high-speed electric train in the region, the Haramain High-Speed Railway spans over 450km, connecting five stations across Makkah, Jeddah, King Abdul Aziz International Airport, King Abdullah Economic City and Madinah, says Arab News.