Carl Edwards couldn't have picked a better time to snap his long winless streak.

Edwards wiped away two years of frustration Sunday by winning the Sprint Cup race at Phoenix International Raceway—his first Cup win in 71 races.

Edwards, who lost the 2011 Cup championship to Tony Stewart on a tiebreaker, had not won a race since the third race of that season, at Las Vegas Motor Speedway. To top it off, Edwards won the Subway Fresh Fit 500 while driving the Subway-sponsored car.

Edwards performed his trademark backflip after climbing from his car at the start/finish line and then went into the grandstand to celebrate with fans.

"This is huge," Edwards said. "This is a Subway race and we won it. We’re back."

After losing the 2011 title, Edwards struggled last season, missing the Chase for the Sprint Cup and finishing 15th in the final standings.

After going winless last year, Edwards switched crew chiefs during the offseason, with Roush Fenway Racing pairing him with veteran Jimmy Fennig, who led Matt Kenseth to six wins the past two years.

Jimmie Johnson, who chased Edwards over the final 70 laps, finished second followed by Denny Hamlin, Brad Keselowski and Dale Earnhardt Jr. Earnhardt led a portion of the race, but lost the lead to Edwards on pit road and then spun his tires on the ensuing restart, letting Edwards get away.

Edwards led earlier in the race but won the race off pit road on his final pit stop to regain the lead. He held off Johnson and Earnhardt on the restart to hang onto the lead.

Edwards seemed to be cruising when a caution flag flew for Ken Schrader's crash with three laps to go. Edwards held off Johnson on the final restart, with a push from fellow Ford driver Keselowski.

“Jimmy Fennig is the man," Edwards said of his new crew chief. "The pit crew was unreal, they won this race for us."

Edwards, who scored his 20th career victory, had to face questions all last season about his slump and when he was going to win again. He vowed to bounce back this season, but was involved in four wrecks during Speedweeks, including one in last week's Daytona 500.

Sunday's win made up for all that and relieved more than a year of frustration.

“I told (one of his crewman), 'I was about to start getting mad,'" Edwards said. "I try to stay positive, but we really, really like winning and I just can’t say enough about everybody believing in me. I’m telling you, we are back. This is going to be big.

"Whatever you are doing out there, don’t lose hope. You just keep digging and things can work out. I’m proof. This is just awesome, one of the coolest wins of my life."

Johnson chased Edwards over the last 70 laps but had to conserve fuel while Keselowski chased him from behind. Hamlin made a wild move, diving to the apron of the track, to pass Keselowski and catch Johnson on the last lap. He raced Johnson door to door to the checkered flag, with Johnson beating him by inches.

Hamlin, who won this race last year, had to go to the rear of the field at the start because his team had to change an engine. He spent most of the race trying to work his way to the front.

"We overachieved today," he said. "That's what you have to do when your car is not that good."

Earnhardt thought he had to a chance to win until he had to dodge Casey Mears' car on pit road on his final pit stop and then spun his tires on the next restart. Still, it was a good finish after finishing second in the Daytona 500.

"We used strategy to get up front and showed we had a pretty good car," he said. "Our car was good enough to make some passes. It was a good run and a good sign for us."

It was a rough weekend for Danica Patrick, who made history last week by winning the pole for the Daytona and finishing eighth in the race, both firsts for a female driver. Patrick struggled all weekend, qualifying 40th and then crashing after blowing a tire on Lap 184.

"Bummer," Patrick said. "We've got basically a junked car. I'll be signing a lot of sheet metal, a lot of body work (for souvenirs) after this week."

Kyle Busch also had a tough day after winning Saturday's Nationwide Series race. Busch had to go to the rear of the field after his team had to change the engine before the race.

He charged through the field, racing his way to 15th, before spinning and crashing on Lap 47. Busch worked his way back onto the lead lap, but brushed the wall again late in the race and finished 23rd.