SPARTA, Ky. (AP) Brad Keselowski's calm demeanor was never more evident than his cool response to a tense moment.

He radioed crew chief Paul Wolfe that his No. 2 Ford was out of fuel but stayed focused, heeding instructions to milk whatever mileage he could.

Keselowski ended up having enough to become the first three-time winner at Kentucky Speedway on Saturday night, overtaking Kevin Harvick on lap 201 and holding on for the Sprint Cup Series victory.

More from FoxSports

''We ran out with about two (laps) to go,'' he said. ''Somehow we limped it around and stay ahead of Carl (Edwards) and bring it home. This is something I'm not going to forget.

''It's a pretty helpless feeling being out of gas with guys behind you. But there's nothing you can about it, and freaking out ain't going to help anything.''

Matt Kenseth grabbed the lead with six laps remaining but soon pitted for fuel to hand the top spot back to Keselowski, who had just enough gas in reserve to edge Edwards by .175 seconds in the closest victory margin for the 400-mile race. Keselowski's tank eventually ran dry and he needed a tow truck to get to victory lane.

Ryan Newman was third, followed by Kurt Busch and then Tony Stewart in fifth in his final Kentucky race. The three-time series champion is retiring after this season.

Keselowski led three times for a total of 75 laps on his way to his second straight win and series-best fourth of the season that clinched a spot in the Chase for the championship.

All of his Kentucky wins have come in even-numbered years - the others came in 2012 and 2014 - and his latest triumph on the 1.5 mile tri-oval might have been his most impressive in terms of strategy.

The Penske Racing driver pitted just four times after starting second and made the most of his gas tank down to the last drop, withstanding one last charge from Edwards. Those final laps were still nerve-wracking for Wolfe, but he's been in this situation before with Keselowski and things have turned out well.

''I felt pretty good about it (fuel) until the 19 (Edwards) closed up on us,'' he said. ''He was able to go and I think he said, shut it off a little bit down the back and as he got into the corner it picked up. Once we were coming off (turn) 4, I saw he was still under power and I felt like we had it at that point.''

Said Edwards: ''I thought he was out of fuel, but he did a good job.''

Keselowski clearly got a lot from his tires and setup, both of which were important on the resurfaced and reconfigured track featuring higher banking in turns and 1 and 2. He lamented the smoothing of front-stretch bumps he said added character to Kentucky, but quickly adapted to the improvements and new NASCAR rules that reduced downforce and sideforce.

Harvick, the pole-sitter, led for a race-high 128 laps and finished ninth.

Keselowski guided his Ford past Harvick's Chevy on lap 201 after the race record-tying 11th caution. The race then stayed green to the end.

Accidents were the story early on. Some notable names were collected, including Jimmie Johnson, Joey Logano and rookie Chase Elliott.

Some other notes from the Kentucky race:

HARD HIT: Logano's No. 22 Ford was knocked out after hitting the wall, an impact that left him 38th and red-faced. ''That was one of the hardest hits I've had in a while,'' he said. Of his race, he added, ''it doesn't hurt. I think it's just red.''

TIRES HOLD UP: Despite double-digit cautions that quickly made Goodyear's tires an easy target, the package that differed from last month's test held up well. Spokesman Mike Siberini said tires were cut by other factors, but there was no blistering like the type the company found after the June test here.

PARTING GIFT: Stewart received a Kentucky basketball jersey from former Wildcats coach Joe B. Hall and ex-players Jack ''Goose'' Givens and Kyle Macy from the 1978 NCAA championship team.