SONOMA, Calif. — Carl Edwards made Roush Fenway Racing the unlikely organization to end Hendrick Motorsports’ five-race winning streak.

Edwards stopped the Hendrick juggernaut with a win Sunday at Sonoma Raceway, the first career victory for Edwards on a road course. The win came a week after a poor race at Michigan, where Roush failed to put a car in the top 10 for the first time since 2000.

Edwards took the lead on a restart with 25 laps remaining and seemed to have the win wrapped up, but Jeff Gordon nearly chased him down on the final lap. Gordon, a five-time Sonoma winner, had one good look at Edwards but couldn’t pull off the pass.

“That’s the best I’ve got and it almost wasn’t good enough,” Edwards said. “That last lap was ugly. I grew up watching Jeff Gordon do well here, so to have him in my mirror, that is very special.”

It wasn’t a terrible day for the Hendrick organization, which had won every Sprint Cup Series race since Jeff Gordon’s victory at Kansas on May 10. Instead, HMS settled for all four of its drivers finishing in the top seven.

Gordon, the points leader, said he made one mistake in overdriving a turn with about five laps to go, allowing Edwards to build a healthy lead.

“I just couldn’t put enough pressure on him,” Gordon said. “I think had I put some more pressure on him, I saw him really struggling with the (tire) grip level, but he did everything he needed to do. That last lap, I gave it my best effort and closed up on him and he didn’t overdrive it. I was hoping he might slide up and I’d get a run on him.”

Dale Earnhardt Jr. was third after rallying from an earlier incident that wrecked Matt Kenseth. He was apologetic on the radio and after the race.

“I tried to screw it up a couple times in the race, but I calmed down and was able to get a good finish,” Earnhardt said after his career-best finish on a road course. “I got into Matt, I jumped a curb and jumped into the air and just ran into him. Totally my fault. I hope he’s not sore with me.”

FORMULA ONE: Nico Rosberg held off a challenge from teammate Lewis Hamilton to win the Austrian Grand Prix for the sixth 1-2 finish by Mercedes this season.

It was Rosberg’s third win of the year as he extended his lead in the drivers’ championship over Hamilton to 29 points.

Valtteri Bottas was third for his first career podium finish, while Williams teammate Felipe Massa, who started from pole position, took fourth.