Teresa Abelleira opened the scoring while Jennifer Hermoso and Alba Redondo scored twice to give Spain their second victory, which also assured Japan of last-16 qualification after they beat Costa Rica 2-0 earlier in the day.
Abelleira settled any opening nerves with the fastest goal of the tournament when she picked up the ball after an intricate passing move in the ninth minute and fired a shot from long range that rocketed into the top corner.
Four minutes later, Hermoso marked her 100th appearance for Spain with an easy header at the far post after Zambia failed to defend a cross from Alexia Putellas.
Spain continued to dominate after halftime although Zambia goalkeeper Eunice Sakala made several saves. But she was left stranded when Redondo was put through on goal as the forward rounded the 21-year-old keeper to make it 3-0.
Hermoso then grabbed her second — and 50th for Spain — when she pounced on a rebound off the post to fire home, a goal awarded after some confusion over the referee's initial announcement that it was ruled out for offside.
Redondo then beat the offside trap late in the game to score Spain's fifth, also awarded after a VAR review when the assistant referee flagged for offside.
Both Spain and Japan have six points and will play each other on Monday for top spot in the group.
Zambia was only one of four African nations represented in the tournament including Morocco, Nigeria and South Africa.