The 29-year-old battled Conor McGregor's old rival looking to stay in the mix for a world title shot after his last bout in March was deemed a no-contest following an accidental eye poke on Belal Muhammad.
Birmingham-based Edwards had won his previous eight fights and dominated Diaz with forward pressure on Saturday.
Diaz came off the worse as the fighters hit the floor in the third round, with Edwards's punches opening up a pair of cuts on the American's face that began gushing blood.
Edwards suffered a serious scare in the bout's final minute as Diaz connected with a right and followed with a straight left to the jaw that knocked the Jamaica-born fighter back into the cage.
The Midlands man was swaying but Diaz could not get it done and Edwards finished on the right side of a 49-46 decision from the judges.
Prior to their bout, Diaz had not been in the octagon for 18 months and had only fought three times since he stunned McGregor in the first of two meetings in 2016.
The defeat could spell the end of the 36-year-old's career, but his English opponent was not bothered about that talk.
Edwards twice told reporters after their fight he was looking forward to his "world title shot" as he waits to hear if his victory is enough to ensure a rematch with reigning welterweight champion Kamaru Usman, who beat the Briton by unanimous decision in 2015.
Edwards has previously said he believes the outcome would be different if they were to face off again later this year.