The two sides were level at 1-1 after 90 minutes but the tide of the last-16 game changed when Sweden had defender Marcus Danielson sent off for a studs-up, high challenge nine minutes into extra time.
Oleksandr Zinchenko’s left-footed half-volley after 27 minutes gave Ukraine the lead but Emil Forsberg equalized when he hit home a deflected effort from the edge of the penalty area two minutes before halftime.
Ukraine will now take on England in Saturday’s quarterfinal in Rome.