Jacques Laffite came from behind to score his first Grand Prix victory for the Ligier-Matra team in Swedish round of the World Drivers Championship today after a dramactic finish in which leader Mario Andretti was forced to pull over for gas with only three laps to go.

Lafitte completed the 179.6-mile race in one hour 46 minutes and 55.520 seconds. He was more than eight seconds ahead of runner-up Jochen Mass of West Germany in a McLaren. Mass was in a race-long battle with Frenchman Patrick Depiller, who finished fourth in his six-wheel Tyrrell. Carlos Reutemann of Argentine saved the day for Ferrari, finishing third behind Mass to strengthen his third place in the world championship standings.

Niki Lauda, had steering problems with the other Ferrari and was forced to retired on the 52d lap after several pit stops. The Austrian, however, is still second in the overall standings at 31 points, one point behind Jody Scheckter of South Africa. Scheckter, disappeared from the race on the 30th lap after hitting another car in the hairpin bend.

Pole-sitter Andretti, gunning for a record fifth grand prix win by an American Formula One driver, looked like he was speeding to an impressive win until the 69th lap. He drove quickly into the pits for more gas, a stop that lasted 28 seconds and it was enough for Laffite to take over the lead and cruise home. Andretti wound up sixth.