With the game scoreless after extra-time, penalties were needed to see which side would advance, with Brazil prevailing after Portugal missed three spot-kicks on the trot to bow out.
Also through on penalties is Mali, which defeated Germany 4-3 on spot-kicks after a 1-1 draw in Christchurch.
Julian Brandt put Germany ahead on 38 minutes, but Hany Mukhtar missed the chance to make it 2-0 when he saw his penalty saved by Djigui Diarra 11 minutes after half-time.
Two minutes later Souleymane Coulibaly's header made it 1-1, with that scoreline staying the same after extra-time.
And it was the African side which would keep its nerve from the penalty spot to advance to the last four.