KANSAS CITY, Kan. (AP) -- Denny Hamlin was surrounded by Joe Gibbs Racing teammates at the front on the final restart, and that put Chase Elliott in the most difficult and precarious of situations.
Somehow, he figured, he needed to find a way to beat them all to advance in NASCAR's playoffs.
It turned out second place was good enough.
Hamlin roared away with a push from behind from teammate Kyle Busch on the second shot at a green-white-checkered finish, and Elliott was unable to chase him down. But deep in the field, Brad Keselowski was going backward, and the spots he lost in the elimination race at Kansas Speedway were enough to send Elliott through in the final cut-off spot to the round of eight.
Hamlin won the race. Elliott felt almost as if he did.
"You have to stay fighting in these things, especially with the late-race restarts," he said. "Just excited we get to fight another race. Back up against the wall, to come out here and battle for the win, that's what you have to do when you're in the position we were in."
In a bit of irony, it was Keselowski who helped bring out the caution in the first overtime when he got into Daniel Suarez and triggered a wreck that collected teammate Joey Logano. The field was nearing the start-finish line but the caution light came on before the leader took the white flag.
If Hamlin had crossed a split-second quicker, the race would have been over and Keselowski safe.
"I pushed as hard as I knew how and didn't quite do good enough on the last restart and that was it," Keselowski said. "We clawed as hard as we could and there were times it looked like we were going to be fine and times it didn't. In the end it didn't work out."
Kyle Busch ultimately finished third, followed by Kurt Busch and William Byron. But the key was Keselowski, who dropped from 13th to 19th on the final restart and out of the next round of the playoffs.
He ended up three points -- equal to three positions on the track -- below the cutoff line.
Byron was the next driver eliminated despite a strong run at Kansas, where he would have needed a win to advance. Alex Bowman and home-state hero Clint Bowyer also were eliminated.
"I did think we were OK," Keselowski said, "but obviously we weren't."
The win was the fifth this season for Hamlin, who already was in good shape to advance but picked up valuable playoff points with the win. He'd finished in the top five at Kansas twice in the past couple years, but the trip to victory lane was the first for his Joe Gibbs Racing team since 2012.
"This was a tough track for us. We didn't run very good here in the spring," said his crew chief, Chris Gabehart. "We got a few key adjustments that turned us into a dominant car."
The frenzied push to the finish Sunday began when Blaney scraped the wall with 14 to go, causing his tire to go down and a caution flag to fly. Elliott was three points behind Keselowski at that point, but the savior of Hendrick Motorsports' playoff hopes made a big move on the restart to climb to fourth place, and that put the pressure right back on Keselowski to make up ground.
Elliott was still in good shape until another caution flew, jumbling the front of the pack and giving Keselowski a chance. He made a quick stop and picked up three spots on pit road, putting Elliott back in a situation where it appeared he would need a victory to advance.
"I was under the impression," he said.
The entire field got through the first playoff restart cleanly, but Keselowski ran out of room deep in the pack and nudged Suarez, sending him into the wall. Logano also was heavily damaged in the wreck, throwing his own playoff hopes into question as another OT approached.
Hamlin got a good jump on the restart, and Elliott dived low and got in line. He immediately moved forward into second place while Keselowski began hemorrhaging positions, and the change that was made in the final two laps was enough to send Elliott into the next round.
"If you ever get to Homestead, you're going to have to fight for a win," he said. "Proud of the effort. Learned a lot. To be able to come out here and, like I said, in our minds have to win, come and fight for one, to finish second, I think is step in the right direction for us."
OTHER PLAYOFF DRIVERS
Bowyer had a strong finish in eighth, but the playoff contender was a non-factor most of the day despite needing a win to advance. Kevin Harvick started 40th after inspection issues and never making it on the track to qualify, but he worked his way through the field to finish ninth.
"That was not a very good weekend from top to bottom," Harvick said. "I just didn't have a very good car and didn't have a very good day on pit road. Nothing went right all weekend. It was definitely one of the worst weekends we have had in a while."
ALL THE REST
Among non-playoff drivers, Erik Jones was among his three Gibbs playoff teammates in contention for the win before finishing seventh. Jimmie Johnson rallied from a slow start to finish 10th.
UP NEXT
Keselowski won the spring race at Martinsville, though that probably doesn't make him feel much better returning now that he's outside the playoffs. Logano edged Hamlin in the playoff race a year ago.