Hamlin won the pole for Saturday night's race, was decent through the first four 25-lap segments, but was slotted sixth based on average finish for the mandatory final pit stop.
His No. 11 team, one of the top pit crews in the Sprint Cup Series, got him back on track in first. Hamlin was aided when Brad Keselowski, who raced Hamlin off pit road but exited second, was flagged for speeding.
Hamlin controlled the restart and jumped out to a huge lead, and Harvick moved into second and tried to chase down the leader.
But it was never going to be an easy task — every driver in the 20-car field wanted to be out front for the final 10-lap sprint to the finish because NASCAR's current rules package has shown that the leader, in clean air, is very difficult to pass.
Although Harvick briefly closed the gap, he had to get out of the throttle when his car drifted too far up the track, and he never got close enough to even attempt a move for the lead.
Hamlin collected the $1 million prize while giving manufacturer Toyota its first win in the All-Star race and Gibbs its first win in 24 appearances.
“Everybody wants to be an All-Star,” Hamlin said from victory lane.
Harvick finished second and was followed by Busch, who believed Hamlin jumped the restart.
“We restarted second and we're going to have to go to the tape and look at it to see if Denny went too soon,” Busch said. “I was asleep at the wheel on the restart.”
Kyle Busch was sixth in his first race back since he was injured in a February crash at Daytona. Busch missed the first 11 Sprint Cup races of the season after breaking his right leg and left foot when he crashed into a concrete wall in the Xfinity Series opener.
He returned for the non-points All-Star race as a tuneup for next Sunday's Coca-Cola 600, the longest race of the season.
“I was comfortable in the car, everything worked well for me,” Kyle Busch said. “It was definitely progress for everything that has to happen next week.”
Kahne was seventh and followed by Joey Logano and then Keselowski, who said he had to hustle off pit road on the final stop to have any shot at the win.
“Whoever gets the clean air with this format and this rules package is going to drive away,” Keselowski said. “I knew when I came out of my pit stall and the 11 was pulling out with me that I either beat him to that line or lose the race.
“I told my crew chief I'd rather go down swinging than take a strike and wonder what might have been. I swung and missed.”
The race was free of competition cautions, the first time since 2008 there were no yellow flags for on-track incidents or issues.