INDIANAPOLIS — Kasey Kahne needed a break Sunday — and got it.
The 37-year-old driver barely reached the overtime line before the last caution flag came out in a crash-marred Brickyard 400, allowing Kahne to complete a six-hour marathon and snap a long winless streak.
He crossed the yard of bricks under caution with daylight fading and his muscles cramping, just ahead of Brad Keselowski and Ryan Newman.
But even before kissing the bricks and posing for photos, Kahne’s long-awaited victory celebration was put on hold as he dropped to the ground and his crew members tried to rub out the cramps he fought through late in the race.
Afterward, Kahne went to the speedway’s infield medical center where he received intravenous fluids. Other drivers said temperatures inside the cockpits topped 130 degrees.
The wacky race had a little of everything — 14 cautions and 55 caution laps, both race records, three red flags and a 1-hour, 47-minute rain delay. Nineteen cars did not finish. It lasted so long, drivers were racing against the impending darkness as much as they were themselves.
Kahne’s last win came in Atlanta in August 2014.
By any measure, it was a wacky day. The two fastest cars on Indy’s 2½-mile oval — Kyle Busch and Martin Truex Jr. — went out in a crash with 49 laps to go. Truex’s car slid up the track going through the first turn and the Toyota teammates both wound in the wall. Busch led the first 71 laps, 87 of the first 110 and swept the first two stages ahead of Truex.
‘‘That’s the way it goes,’’ Busch said. ‘‘Just chalk it up to another one we found a way to lose.’’
The finish was even wilder. Over the last 16 laps, there were five crashes and two red flags.
The craziness began when Kurt Busch, Erik Jones, and Clint Bowyer got together coming out of the fourth turn. On the ensuing restart, Kyle Larson hit the wall on the front straightaway to bring out another caution.
Things again went awry when Jimmie Johnson, Keselowski, and Kahne went three-wide through the third turn on what was supposed to be the second-to-last lap. But Johnson’s smoking car started spinning and hit the wall to force overtime.
Trevor Bayne got into the mix with two laps in the first overtime when his car was bumped from behind, sending it sideways through the field. Six cars got collected in the crash, bringing out yet another red flag and adding more laps to the race.
Kahne finally ended it by reaching the line just ahead of Keselowski as another multi-car crash occurred behind him.