AVONDALE, Ariz. — Denny Hamlin took the lead on a restart and had to sweat out his fuel mileage over the final few laps to win at Phoenix International Raceway on Sunday.

In his second race with new crew chief Darian Grubb, Hamlin shook off memories of a championship-losing run at Phoenix in 2010 by leading the final 59 laps and holding off NASCAR’s best closer.

Kevin Harvick had Hamlin in his sights over the final few laps, but ran out of gas and finished second. Hamlin was concerned about gas as well, but had just enough to celebrate his 18th career win with a brief burnout.

Greg Biffle finished third and Jimmie Johnson bounced back from a disastrous Daytona 500 to finish fourth despite wheel troubles midway through the 312-lap race.

Hamlin hasn’t had many good memories at Phoenix lately.

He had finished no better than 11th in four previous races. There also was a disastrous finish in 2010 caused by poor fuel strategy that may have cost him a chance at his first Sprint Cup championship.

Dominating the race, Hamlin had to make a late pit stop for fuel and wound up 19th while Johnson was fifth. Instead of a 60-point lead over Johnson, Hamlin was only ahead by 15 after Phoenix and Johnson ended up snatching the title from him at Homestead the next week, his record-setting fifth.

Hamlin finished ninth in the Sprint Cup standings in 2011 and opened this season with a strong run at the Daytona 500, finishing third after qualifying 31st.

Hamlin started 13th at PIR and briefly led a couple of times before beating Harvick off the line after a caution. Following a brief scare by Harvick, he cruised to the checkers when the No. 29 car ran out of gas.

The teams didn’t have much time to prepare after one of the most bizarre Daytona 500s ever.

Weather pushed the start of the race to Monday night and Juan Pablo Montoya’s did-that-really-happen crash into a safety truck during a caution led to a two-hour delay of flames and suds as crews tried to clean the track with laundry detergent.

Adding to the long weekend, many drivers weren’t able to get home after the race because the airports in North Carolina were shut down due to bad weather.

Matt Kenseth came away as the big winner, holding off Dale Earnhardt Jr. to capture his second Daytona 500 title, but Brad Keselowski steered some of the attention in his direction by tweeting updates and photos from the track during the red flag.

Six days later, there were no delays, no jet dryer crashes, no in-race tweeting. Just a track that got slicker as the weekend wore on.

PIR was resurfaced after the 2011 spring race and held up well in the fall. The grip was decent for the early practice session Friday, but the track became tougher as the temperatures rose Saturday and again for the race.

With the sun shining and the temperature in the 80s, drivers fought for traction all day, wobbling and sliding all over.

Kasey Kahne slid into the wall early and Paul Menard did the same after A.J. Allmendinger got loose in front of him near the midpoint of the race. Ryan Newman, in a backup car because of a practice session crash, was knocked from sixth when Carl Edwards got loose with about 60 laps left and Keselowski dropped back when he got a little squirrely a few laps later.