Niki Lauda won his third Formula 1 world auto racing championship yesterday, edging McLaren teammate Alain Prost by a half point after placing second to Prost in the Portuguese Grand Prix at Estoril.

Even his seventh victory of the season, tying the record set by Jim Clark in 1963, wasn't enough to let Prost be the first Frenchman to win the world title.

Prost drove flawlessly and was never in danger of not winning. But he had to concede the championship to the Austrian when for the first time since 1967 the drivers title was decided between two teammates in the season finale.

While Prost took the lead on the ninth lap and went well ahead of the field, Lauda drove strongly to move up from 11th starting place on the grid. Within 30 laps he was third, but he knew he needed to go one better to deny Prost the championship and add to his own 1975 and 1977 titles.

Lauda was almost 40 seconds behind second-placed Nigel Mansell in a Lotus. The champion got his break when Mansell spun on the 51st lap and had to retire from the 71-lap (187.94-mile) race because of brake failure.

From there, Lauda was well clear of the next racer, Ayrton Senna. Prost won in 1 hour 41 minutes 11.753 seconds; Lauda took 1:41:25.178.

The six points Lauda earned for second place left him with a season total of 72, to Prost's 71.5. It is the second successive year Prost was edged for the title in the final race.

"I didn't think I could do it," Lauda said. "It was the hardest race of my life. I took risks I've never taken before but when I saw Mansell in the pits I knew I was lucky" . . .

Bill Elliott charged past Harry Gant on the fourth turn of the final lap and won the Warner W. Hodgdon American 500 NASCAR Grand National race at North Carolina Motor Speedway in Rockingham.

Elliott, driving a Ford, had taken the lead from Gant on lap 438, but had to rally on the last circuit for his third superspeedway victory of 1984.

Gant drove his Chevrolet past Elliott on lap 491, one lap before the end on the 1.017-mile oval, but Elliott passed him and took the checkered flag by the distance of his front fender.

"I don't know what I could have done differently on the final lap," said Elliott.

The race was halted for 1 hour 15 minutes, after 35 laps, because of rain.

Terry Labonte, the Winston Cup points leader, and Darrell Waltrip also finished on the lead lap. Bobby Allison, with a shoulder injury, gave up his seat to Neil Bonnett on lap 185 after Bonnett's Chevrolet was sidelined in an eight-car accident on lap 171 also involving pole sitter Geoff Bodine.