Leo flattened Lopez with a hard left hook to the chin, sending the champion falling flat on his back to be counted out at 1:16 of the 10th round while the crowd roared and the new champion celebrated.
Lopez, coming off a March stoppage of Japan's Reiya Abe, was defending his title for the fourth time and seeking a 14th consecutive triumph but instead fell to 30-3.
Leo, a former World Boxing Organization junior featherweight world champion, improved to 25-1 with his 12th knockout victory in the battle of 30-year-old fighters.
Lopez opened a cut under Leo's right eye in the eighth round but most of the fight was a toe-to-toe exchange of punches and clinches from the hard-firing fighters until Leo's decisive final blow.