It was the 20th career Sprint Cup win for Edwards, but first in 70 races since taking the 2011 event at Las Vegas Motor Speedway.
Johnson, coming off last week's Daytona 500 triumph, barely bested Hamlin to claim the second spot.
Hamlin settled for third after attempting to pass Johnson and Keselowski on the track apron during the final lap.
Keselowski claimed fourth while Dale Earnhardt Jr. rounded out the Top 5.
Millions of Getty images now available for free via embed tool
Ray Liotta sues skin care company over use of likeness