The challenger recovered from an early cut to his left eye to shock the home favourite after two of the judges scored the bout in favour of the Mexican, with the other deeming the contest a draw.
It ends Warrington's hopes of a unification fight in 2023 and further spoiled the party after the main event had been delayed by England's World Cup quarter-final defeat to France.
Despite an electric ringwalk and atmosphere, it was Lopez who made the stronger start and he was able to draw blood from the nose of Warrington during the opening round.
Lopez needed treatment in round two after an accidental clash of heads left the Mexican with a cut on his left eye.
Parallels could be drawn with Warrington's second clash with Mauricio Lara last year, called off early as a technical draw due to similar circumstances.
Lopez carried on, however, and appeared unfazed with his more accurate shots causing the home favourite all sorts of problems.
Warrington started to find his range in the middle section of the fight and produced a big left hook in the sixth round.
Challenger Lopez was still smiling and chatting away while regularly handing out punishment to the body of the British boxer.
The tempo increased in the latter stages with the duo trading blows, but despite a brilliant final round from Warrington the Mexican stood firm to ensure the judges would decide the winner.
While one of the scorecards went with a 114-114 draw, the other two were 115-113 in favour of Lopez to give the 29-year-old the biggest victory of his career.
Warrington told DAZN: "I'm absolutely devastated losing my title like that but I want to say a big thank you to all these for making noise, so thank you.
"I did have aspiration of doing other things. Obviously I wanted to go to the (United) States and I still want to do that. Maybe unifying is a step too far but I think I can still fight one of the other champions. Obviously I would have the rematch as well because I thought I was a little hard done by there."
Lopez added: "I'm really happy at the moment. It has been a long period of preparation. As I said in the build-up, this is my moment, it comes from hard work. I'm delighted to be world champion.
"To be honest I had to respect him coming into his city, in front of his people. I knew he was a dirty fighter but he surprised me even more, he was hitting me to the legs, in the gut and the referee I didn't feel did his work."