"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."
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."
Hamlin's best finish at Kansas had been third last year, and for most of Sunday he was content to ride around during long green-flag runs out of the spotlight. His car kept getting better with each stop, though, and his Toyota finally took off at the end.
Just as the sun finally poked through on an unseasonably cold day.
"They didn't panic," team owner J.D. Gibbs said. "They paced themselves, and I'm glad the sun stayed out a little at the end."
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.
"Sorry guys, I lost this one for you," a despondent Truex radioed to his Michael Waltrip Racing team.
"Hey man, you did a great job," came the reply. "They know we were here."
Truex said his final set of tires cost him. He was the loosest he'd been all race, and that allowed Hamlin to charge into the lead. Truex rallied within a car length with two laps to go, but he couldn't make a move on the bottom side stick, allowing Hamlin to pull away.
"I guess if we can be this frustrated with second, it tells you how close we are as a team," said Truex, who hasn't won since Dover in 2007. "The race car was really good. I'm just not really sure what to think about that last set of tires. I was just wrecking-loose that last set."