Brazil entered the tournament among the favourites after an impressive group stage campaign, while Norway arrived as underdogs despite building momentum behind Haaland's goals.
Norway thought they had taken an early lead, but the goal was ruled out for offside.
Brazil were then handed a golden chance to take the lead from the penalty spot, only for Bruno Guimarães to see his effort saved by goalkeeper Ørjan Nyland.
Nyland produced several outstanding saves to keep Brazil at bay as the South Americans wasted chance after chance.
The breakthrough finally came in the 79th minute when Haaland headed home from a cross. The Manchester City striker sealed the famous victory in the 90th minute with a powerful low strike from outside the box.
Neymar pulled one back from the penalty spot deep into stoppage time, but it came too late to rescue Brazil.
The defeat ends Brazil's World Cup campaign far earlier than expected, while Norway advances to a historic quarter-final against England on July 19.
The result is already being hailed as one of the biggest upsets in recent World Cup history and marks another painful chapter in Brazil's long wait to reclaim football's biggest prize.