WATKINS GLEN, NY - AUGUST 10: Crews work to repair the barriers after an on-track incident that brought out a red-flag during the NASCAR Sprint Cup Series Cheez-It 355 at Watkins Glen International on August 10, 2014 in Watkins Glen, New York. (Photo by Jared C. Tilton/Getty Images) Jared C. Tilton Getty Images

WATKINS GLEN, NY - AUGUST 10: Crews work to repair the barriers after an on-track incident that brought out a red-flag during the NASCAR Sprint Cup Series Cheez-It 355 at Watkins Glen International on August 10, 2014 in Watkins Glen, New York. (Photo by Jared C. Tilton/Getty Images) Jared C. Tilton Getty Images

WATKINS GLEN, NY - AUGUST 10: Crews work to repair the barriers after an on-track incident that brought out a red-flag during the NASCAR Sprint Cup Series Cheez-It 355 at Watkins Glen International on August 10, 2014 in Watkins Glen, New York. (Photo by Jared C. Tilton/Getty Images) Jared C. Tilton Getty Images

WATKINS GLEN AJ Allmendinger's greatest day came on one of the worst for NASCAR.

The California native broke through for his first career Sprint Cup Series victory Sunday afternoon, holding off Marcos Ambrose to win the Cheez-It 355 at The Glen.

The day began on a somber note after five-time Watkins Glen race winner Tony Stewart was involved in an incident Saturday night in which race car driver Kevin Ward Jr. was killed after he was struck on the track by Stewart's car at Canandaigua Motorsports Park.

Stewart removed himself from Sunday's race and was replaced by Regan Smith, who was involved in a late wreck and finished 37th.

Allmendinger, driving for the one-car JTG Daugherty Racing team, regained the lead on the 89th lap of the 90-lap race shortly after Ambrose passed him earlier in the lap.

"I knew I was going to have pull every trick out of the bag that I could," said Allmendinger, who was supported at the race by his parents and girlfriend.

The victory lifts Allmendinger from 25th in the Sprint Cup points standings to an all-but-guaranteed berth in the Chase for the Cup.

Sunday's race was delayed three times by red flags. After the third one following separate crashes involving Denny Hamlin and Alex Kennedy, racing resumed with two laps remaining.

Ambrose, the runner-up, tapped Allmendinger from behind in Turn 1, and they made more contact through the Inner Loop as Ambrose pulled ahead. Allmendinger outmaneuvered Ambrose to get back in front a short while later.

Allmendinger, 32, was not seriously challenged in the final lap, denying Ambrose his third Cup victory here and a berth in the Chase for himself.

"He didn't try to wreck me. He just tried to move me," Allmendinger said of the frantic 89th lap. "I got through the bus stop (Inner Loop) and I got a little loose through there, and I knew I kind of checked myself up. And as I said, he could have probably drove through and cleared me out, but he just moved me enough to get that car on the bottom that he needed.

"But I was able to hold the outside of him and knew I had the next corner, and I kind of leaned on him getting into the left-hander, just know that if I can make him drive in deep with me and I can make the corner and he messes it up, if they (Ambrose and Kurt Busch) get racing behind me and and I get a three-, four-car length gap, you know, I have a good shot at this thing."

Ambrose said, "There was a lot of door banging going on, a lot of corners we went through side-by-side. I got my tires really hot during that and I slid off Turn 11 after I got the lead, and he was able to get it back before the caution dropped. That was probably the difference between winning and losing the race right there."

"He won the race in a fashion that everyone is proud of him for doing," he said. "Allmendinger deserves this win. He did a tremendous job to race Ambrose, one of the best guys in the world at driving these stock cars."

The race was disrupted for 1 hour, 21 minutes, 42 seconds following a violent accident involving Ryan Newman and Michael McDowell on the 56th lap. Greg Biffle got slowed leaving the carousel, and Newman spun out behind him, hitting the fence and skidding back out onto the course. Newman's spinning car then slammed into McDowell as he tried to get past.

There was heavy damage to the guardrail and cars involved, bringing out two red flags that were separated by a caution to clear cars from the track. Newman and McDowell were able to walk away from the damage. Danica Patrick barely avoided the mess, along with some other drivers.

Newman criticized the road course.

"It's a very antiquated racetrack, and the safety is not at all up to NASCAR standards," he said.

Allmendinger took the lead on the 61st lap when he passed Edwards, who inherited the top spot after leader Jimmie Johnson pitted on the restart following the long delay.

Ambrose passed Busch for second place on lap 66, but the Australian could not reel in Allmendinger. Ambrose was helped when Josh Wise spun out on the 78th lap to bring out a caution and tighten the field.

Pole-sitter Jeff Gordon led the the first 29 laps Sunday, but his bid for a fifth Sprint Cup victory here was ruined when his car lost power on lap 50 and slowed dramatically on the track.

"I've got no power," he said over the radio to his crew. "Just cut off clean. All the power just cut out."

Kasey Kahne inherited the lead from Gordon on lap 30 when Gordon went to the pits. Ambrose, who pitted one lap earlier, got to third and Gordon to fifth when they returned from their stops.

Kahne went to the pits after leading for three laps, and Ambrose grabbed the top spot. Pit stops allowed Gordon to move up to second two laps later before bad luck struck.

Kyle Busch, the winner of last year's Cup race here, finished 40th after a broken car frame limited him to 69 laps.

WGI President Michael Printup estimated that up to 500 more people attended Sunday's race than the 94,000 who came last year.