Former featherweight world titlist Oscar Valdez made a successful move up to the junior lightweight division — just not against the opponent he thought he would face — and earned a shot at a world title in a very tough fight Saturday night.

Valdez survived a second-round knockdown and some shaky moments, but stopped Adam Lopez in the seventh round of their 130-pound world title elimination bout in the main event of the Top Rank Boxing on ESPN+ card inside The Chelsea at The Cosmopolitan of Las Vegas.

Valdez was supposed to face Adrian Gutierrez, but he showed up at Friday’s weigh-in at a shocking 141 pounds, 11 over the contract weight.

Lopez was supposed to face Luis Coria in a 10-round preliminary bout at featherweight, but with Gutierrez so heavy, Top Rank offered Lopez the opportunity to face Valdez, whom he has known for years and wanted to fight. Lopez consulted with trainer Buddy McGirt and agreed to the new assignment and a bigger paycheck.

Lopez (13-2, 6 KOs), 23, of Glendale, California, gave a tremendous effort and had his moments, but Valdez (27-0, 21 KOs), 28, a two-time Olympian from Mexico, drew on his vast experience advantage.

“My experience made me win the fight,” Valdez said. “I have a great amateur background and a lot more experience than him, and I think that’s what made me win the fight. He’s a great fighter, but I think my experience made me win.”

The victory propelled Valdez, who earned $300,000 to Lopez’s $75,000, into a mandatory shot against countryman Miguel Berchelt, who was all smiles in the ring after the fight when he and Valdez embraced.

Lopez looked like he might pull the upset against Valdez when he connected with a clean left hook to the chin that knocked him down with about 50 seconds to go in the second round. Valdez, who hit the mat awkwardly, never saw the shot coming and looked a little unsteady when he got to his feet, but he made it through the round without taking too much more damage.

“I was very surprised [by the knockdown],” Valdez said. “I take my hat off to Adam Lopez. He’s a great fighter, great warrior, just like his father [the late Hector Lopez] was. I just got hit. This is boxing. I prepared myself for two, three months for Gutierrez. Got a new opponent, but that’s no excuse. This kid is a warrior.”

Valdez tried to pressure Lopez in the third round, but it was ineffective because Lopez gave him angles, moved laterally and landed punches. But Valdez continued to press forward and was able to land some solid right hands. However, Lopez returned fire time and again and worked well from the outside. It made it awfully difficult for Valdez to connect with his left hook.

In the fifth round, Lopez forced Valdez to the ropes and unloaded several punches. Valdez is a come-forward fighter and has difficulty fighting off the back foot. But when he can move forward and land punches he is very dangerous, as Lopez found out in the seventh round.

Valdez landed a huge left hook to the head and a right hand behind it to score a knockdown midway through the round. Lopez beat the count, but he was bleeding from the nose and Valdez was all over him. He cracked him with an uppercut and was going for the finish. He unleashed seven unanswered punches, including a pair of thunderous right hands that rocked Lopez, causing referee Russell Mora to step in and stop the fight at 2 minutes, 53 seconds.

Lopez thought it was a bit of a quick stoppage but did not complain too vociferously.

“He hurt me, but I was up, I was fine. I was blocking shots,” Lopez said. “I think he caught me one time, and the referee jumped in and stopped it. I think I would’ve been fine if I would’ve finished the round. I would’ve come back. I think I was up on the scorecards, and it’s just a shame, but this is boxing. I can’t do nothing about it.”

Lopez was ahead 57-56 on one scorecard but trailing 58-55 and 57-56 on the other two at the time of the stoppage.

According to CompuBox statistics, Valdez landed 91 of 330 punches (28%) and Lopez connected with 92 of 436 blows (21%). Although Valdez had some problems, he closed the show by outlanding Lopez 21-7 in power shots in the seventh round.

“I would love a rematch with Oscar. He’s a true fighter,” Lopez said. “I’m not a 130-pounder, but I’m a real fighter as well, so I’ll take on anybody, anywhere. Let’s get a rematch. I’m glad people know who I am now. I can fight. People love my style. This is what I do. It’s in my blood.”

Indeed boxing is in his blood. His father, the late Hector Lopez, was a 1990s lightweight and junior welterweight contender and 1984 Olympic silver medalist for Mexico. He died at age 44 in 2011.

Valdez, who was in his third fight since switching trainers to Eddy Reynoso — who also trains Canelo Alvarez — made six featherweight title defenses before vacating his 126-pound belt in early August to move up in weight. With Lopez vanquished, Valdez will next get a shot at Berchelt (37-1, 33 KOs), 28, who has made six title defenses and is generally considered the No. 1 fighter in the world at 130 pounds.

“Miguel Berchelt is a true champion inside the ring and outside the ring,” Valdez said. “The fans love him. He’s a champion. That’s the one I want to fight. He has that WBC belt, and he’s trying to take it back home.”