KANSAS CITY, Kan.

- The sun shined brightly on Denny Hamlin at Kansas Speedway.

At the most opportune of times, too.

Hamlin's car hooked up after the final pit stop Sunday, just as the sun finally broke through on an overcast afternoon, and he powered by Martin Truex Jr. for the lead. Hamlin then managed to hold off a late charge by Truex to win for the second time this season.

"Whether it was coincidence or not," Hamlin said, "our car definitely felt better when the sun came out. I felt the car lost a lot of grip, but I guess a lot of guys did."

It was Hamlin's first career win at Kansas, and gave his Joe Gibbs Racing team some momentum heading to Richmond, where the Virginia driver has won twice in 12 career starts.

"I felt all day I was behind the 56 and his car looked so superior to the whole field, and we just needed some kind of change - the weather, an adjustment - to make something happen," Hamlin said, smiling. "And we got both of them."

Truex dominated most of the afternoon, leading a race-high 173 laps, but had to settle for second place. It was his third top-5 finish of the season, but he's yet to win in 175 races.

Jimmie Johnson was third for Hendrick Motorsports, which has failed in 14 tries to win the team's milestone 200th race. Dale Earnhardt Jr. and Kasey Kahne also finished in the top 10.

"I was just watching from the third spot, hoping those guys would give me an opportunity," Johnson said. "I just wish I was closer to those guys to race for it."