David Ragan held the lead on the first attempt at the finish, but drew a penalty for changing his position before the restart.
On the second try, Bayne held off Edwards on the final lap to become the youngest winner in the 53-year history of the Daytona 500. He celebrated his 20th birthday Saturday at the track.
Edwards ended up in second place, with David Gilliland, Bobby Labonte and Kurt Busch finishing in the 2-through-5 spots.
The first race on the newly paved, 2.5-mile speedway was a wild one, featuring the most-ever lead changes (74), different leaders (22) and cautions (16).
Exploding whale video goes viral on Internet
Couple mistakenly served bag of cash at McDonald's drive-thru