It was a controlled start by Andersson, 2.4 seconds behind leader Jessie Diggins at 2.0km.
The Swede extended her lead to most during the course of the race and looked strong as she crossed the finish line.
When Andersson entered the race, home rider Delphine Claudel, who had been assisted by Andersson, continued out on her last lap by herself.
She was almost 14 seconds behind at the halfway mark but spooked to be just 7.3 seconds behind at 8.1.
However, the French could not match Andersson at the end, but pleased the home crowd by finishing second.
Jessie Diggins, who was offensive, finished third.
Andersson contracted covid-19 after the competitions in Lillehammer at the beginning of December and has since only competed in the Scandinavian Cup.
Frida Karlsson, who fell ill after the Tour de Ski, chose to stay in Sweden and train.
The World Cup begins in Planica, Slovenia, on February 22.
SEE ALSO: The Swedish star's words before the World Cup comeback
Javascript is disabled
Javascript must be enabled to play video
Read more about browser support
Ebba Andersson is ready for a comeback in the World Cup.
Photo: Bildbyrån