And on a cooling track, Hamlin's worn tires simply gave out.
With the sun setting Sunday over Indianapolis Motor Speedway and Hamlin seven laps from victory, he went careening into the first turn wall, and Harvick beat Matt Kenseth off the final restart to pull away.
"We knew he was really close on tires so (crew chief) Rodney (Childers) said on the radio to keep the pressure on him," Harvick said. "It's the Brickyard, this is what I grew up wanting to do so to come here and win for the third time is something I couldn't have dreamed up."
Harvick won for the 53rd time to move within one of tying Lee Petty for 11th on NASCAR's career list, and it gave Stewart-Haas Racing a sweep of the weekend following Chase Briscoe's win Saturday in the Xfinity Series race.
For the third straight race, Harvick and Hamlin were in a league of their own.
Until the stunning twist as the sun was setting over the historic 2.5-mile oval, it looked is if Harvick and Hamlin would sweep the top two spots for the third consecutive race.
How good have they been?
Each has won four times, tied for the most in the series. And since racing resumed at Darlington in mid-May, Hamlin and Harvick have combined to win seven of 12 races.
But the crash ended Hamlin's run of four straight top-five finishes with Joe Gibbs Racing.
"It's just, it's tough. I hate it for the FedEx team," Hamlin said. "It was just kind of roulette if it stays together or not and mine didn't."
NASCAR's weather problems continued, too, with the start delayed 55 minutes because of lightning strikes within an eight-mile radius of the track.
On Lap 16, the race was red-flagged briefly after a six-car pileup near the entrance of pit road. Five of those involved didn't finish the race and each was checked at the infield medical center and was released.
But NASCAR officials said Ryan Blaney's tire changer, Zachary Price, was transported to a hospital after getting pinned between Blaney's car and another. Price appeared to be smiling as he was placed on a stretcher before he was taken away in an ambulance.
Blaney continued racing in the No. 12 Ford and Justin Allgaier got in three more laps before calling it a day. Allgaier replaced Jimmie Johnson in the No. 48 after Johnson tested positive for coronavirus on Friday.
— Will Kunkel (@WillKunkelFOX) July 5, 2020
Johnson's absence ended the longest active streak of consecutive starts at 663 -- fifth overall -- and perhaps his quest to join Jeff Gordon and former Formula One star Michael Schumacher as the only five-time winners at Indy. The 44-year-old Johnson said he would be watching from his home in Aspen, Colorado.
It's the first time since 1993 that the No. 48 was used in a points race without Johnson driving.
"I didn't know if I got the gentleman on the No. 12 or not," Allgaier said. "Once the wreck started happening in front of us and we all got bottled up there, one car after another was getting run into. It's just a shame. I hate it for these guys."
It was a tough day for Kurt Busch, whose hopes of winning in his 700th career start ended with an early pit stop mistake. A plane flew over the track during pre-race activities to celebrate the milestone. Busch broke a tie with Hall of Famer Buddy Baker for No. 16 on NASCAR's career list and moved within six of tying Rusty Wallce for No. 15.
William Byron won the first stage after deciding not to pit under caution with nine laps left and Harvick led the final 12 laps to claim the second stage.