Goalkeepers Pawel Kieszek and Gianluigi Donnarumma were both among the culprits to miss their spot-kicks as Milan emerged 9-8 winners.
Both sides had scored their first seven penalties, missed their eighth, and then both scored their ninth as tensions began to rise.
There was then a torrid spell with each side missing two consecutive penalties each, including both goalkeepers blazing their attempts over the crossbar.
Milan’s Donnarumma eventually made amends by getting a strong hand to Aderaln Santos’s effort to bring the marathon shootout to a close.
Penalties galore
The game itself was full of drama before reaching its nail-biting conclusion.
Milan had been trailing 2-1 deep into extra-time and, ironically, needed a last-minute penalty to take the tie to a shootout.
Hakan Calhanoglu stepped up to equal the score in the dying seconds of the match after a defender handled the ball in the area.
“It’s a magical night; for us it would have been a shame not to get past this round,” Milan coach Stefano Pioli told reporters after the game.
“This victory gives us strength to keep working and winning.”
The seven-time European champions are still been unbeaten in all competitions since March 8 and will await the Europa League group stage draw on Friday.