With a one-lap lead and a former Formula One driver, Thierry Boutsen, behind the wheel, Toyota had appeared poised to claim their first win at Le Mans, but shortly after the final scheduled pit stop, the Toyota GT One developed transmission problems, handing the lead to Britain's Alan McNish and French co-drivers Laurent Aiello and Stephane Ortelli, who covered the 13.6km (8.456-mile) circuit 351 times.
McNish, at the wheel for the final stint, led a Porsche one-two finish, crossing one lap ahead of Jorg Muller and Uwe Alzen of Germany with the Frenchman Bob Wollek, who left Le Mans without a win for the 28th time.
Nissan Motorsports' all-Japanese entry of Kazuyoshi Hoshino, Aguri Suzuki and Masahiko Kageyama was third, four laps adrift.
The win, coming in Porsche's 15th appearance at Le Mans, marked the first time that a manufacturer had claimed three consecutive wins since the German firm won seven in a row between 1981 and 1987.
Mercedes - making their first appearance since 1991 - had been strong in the early stages of the race, but both cars succumbed to mechanical problems within 30 minutes of each other in the first 12 hours.
Martin Brundle led a Toyota charge at the start of the race and he went on to clock a lap record of 3min 42.817sec, an average speed of 219.817kph (137mph), and took another second off that time 83 laps later, but his hopes of a second Le Mans title disappeared when his engine failed just after the midway point.
Just 24 of the 47 cars on the starting grid completed the race.Reuse content