The blaze began shortly after midnight between J38 at Redhouse and J39 at Barnsdale bar.
West Yorkshire Fire and Rescue Service and South Yorkshire crews were called to the scene.
A full closure was put in place between J38 to J39.
Update: The road had reopened by 2pm, but a lane one closure remains in place due to damage to the road which will need resurfacing overnight.
Highways England issued a statement at 2am which said: "The A1 is closed northbound between J38 and J39 near Doncaster due to a lorry fire.
"South Yorkshire Fire and Rescue are at scene and continue to tackle the blaze.
"Recovery agents are en-route , early assessments suggest that this will be protracted due to the damage to the vehicle with the road likely to remain closed through the day.
"There are long delays on the approach to the closure, with additional journey times also expected on the diversion route so please allow extra time for your journey or seek an alternative route if possible.
"Traffic is diverted to follow the hollow triangle symbol - via the A638 northbound for approx. 4 miles. At North Elmsall roundabout, take the A6201 eastbound back to the A1 via Wrangbrook."
The motorways agency later issued an update at 4.20am saying that the road would be closed "for some time" due to the nature of the fire.
It said: "Due to the complex nature of this incident involving multiple agencies, the full closure will remain in place for some time. Please consider M1 or M18 for alternative routes."
At 6.25am, Highways England issued a further update, saying the road would be closed for at least four hours.
It also warned drivers to expect significant delays.
Highways England said: "The recovery of this vehicle and is load will take at least 4 hours then the road will need to be assessed as it is likely to need resurfacing before reopening.
"Expect significant delays through the morning."