A spokesperson for Germany's national railway attributed the fire to a technical defect that caused a transformer to ignite around 8:45 pm, when smoke began billowing from the train's engine.
Fire department workers reported seeing flames spewing from the train's ventilation grill.
The 350 passengers travelling on a high-speed ICE train between Cologne and Berlin were removed and no injuries were reported, the railway spokesperson said.
Fire department workers battled the blaze for two hours before giving the all clear signal. They used chemicals instead of water to protect the train's electrical system.
“We had the situation under control at all times,” a fire department spokesperson said.
The train remained on the tracks overnight to cool off before being transported for repair.
There were no major disruptions in train traffic and the passengers boarded another train for Cologne.