That fed them into an all-African round-of-16 clash with Ghana in Wellington. It turned out to be one of the best team performances of the tournament.
Mali took the game to their African neighbours and scored three absolutely superb goals.
Deep into the game they were still passing the ball in all parts of the ground to the delight of the crowd.
African teams have always been renowned for their physicality - and there are some enormous teenagers in their squads - but their passing game has progressed to the point where they are now the equal of many of the European and South American sides when it comes to ball retention.
But Mali couldn't beat Germany in the quarter-finals, could they?
When they went 1-0 down in Christchurch, it appeared normal service would resume and Mali would depart with heads held high, but ultimately eliminated in the quarter-finals.
Instead, they came roaring back and scored a lovely equaliser, forcing the game into extra-time and eventually a penalty shoot-out.
Surely though, that would be it. You can't beat Germany on penalties.
At 3-3, Mali's Adama Traore missed his spot-kick. This was it. Mali were going out, courageous, but finally defeated.
Instead, the Germans - always so clinical from twelve yards - missed not one, but incredibly two spot-kicks and Mali were through.
Mali were through. Astonishing.
In Wellington, Senegal became the second African team to make the final four, beating Uzbekistan 1-0. On the balance of chances and possession, they totally deserved it, limiting the Uzbekistanis to a solitary shot on target.
Regardless of that, Senegalese goalkeeper Ibrahima Sy still managed to catch the eye. His flamboyance and energy between the sticks has been a highlight of this tournament.
So here we are with the very real possibility that Saturday's World Cup final could be an all-African affair.
For that to happen, Mali will have to get past Serbia and Senegal need to topple Brazil.
It seems unlikely, but if this tournament has shown us anything, it's that we should expect things to happen which don't seem feasible.
It's entirely possible Mali could play Senegal in the final.
You'd get few complaints about that from fans who have delighted in the fearlessness and flair, the passing and panache, the stamina and the skill of the wonderful African sides at this World Cup.