There were very few chances in normal time, with Josip Drmic missing a glorious chance in the first half, and it looked destined for penalties until Di Maria's late winner.
Here, Sports Mole analyses the action to see how Argentina got through.
On target: 22
On target: 7
Was the result fair?
A winner in the closing stages of extra time is hardly a fair way to go out of a tournament, but if either of the teams deserved to get through it was just about Argentina. Neither side created enough really good chances throughout, so penalties might have been a worthy decider, but it was Argentina's extra energy and effort in the final 30 minutes that just about saw them through. They had more of the ball and twice as many shots, but still they were not dominant.
Definitely their worst showing of the tournament so far. With Switzerland's two- or three-man hounding of Lionel Messi shutting him out of the game for long spells Argentina were nearly shown up for a lack of quality. After about 30 minutes Argentina resorted to shots from range and, although they had a lot of them, they will be worried about the lack of clear-cut opportunities. They will have to improve to go further.
They were brave, compact and tactically excellent against Messi, but when push came to shove they just did not have enough quality in the final third. Drmic should have given them the lead but was guilty of a horror miss in the first half, but aside from that they did not trouble Argentina enough going forward. At the back they did next to nothing wrong, but they just ran out of energy in extra time and were punished late on.
Sports Mole's man of the match
Valon Behrami: A very tough call owing to the lack of players who really stood out throughout, but Behrami's energy in the middle, his timing in the tackle and calmness when on the ball just about gets him the nod. It was not a game for the purists, but Behrami played out Ottmar Hitzfeld's tactics almost perfectly.
This simply has to be Drmic's bizarre decision to try to chip Sergio Romero when through on goal in the first half. He was played in by a Xherdan Shaqiri flick and after Romero decided not to come for it he should have slotted either side of him. In the end he lobbed it right to the goalkeeper's chest and the best chance of the match was wasted.
It was a tough match for Jonas Eriksson to officiate, as there was a lot of tension and plenty of tackles flying in. He could have gone to his pocket early on, but would have set a precedent and in the end erred on the side of leniency which was the right call. There were no major calls to make and he did very little wrong overall.
Argentina: They are just about through to the quarter-finals and will now await their next opponents from the final round-of-16 clash between Belgium and USA tonight.
Switzerland: It is time to go home for Switzerland, but they have given a good account of themselves. Hitzfeld's managerial career comes to an end on a slightly sour note, but he has done wonders for the nation.