Madrazo broke free in the final 500 meters (547 yards) of the 170-kilometer (105-mile) stage, which ended on a mountain top by an astronomical observatory in the city of Arcos de las Salinas. "To win here is one of the biggest achievements as a cyclist and for me it's become a dream come true," the Spanish rider said. "The team was telling me to save energy for tomorrow, for the mountain points. And I told them, 'No, no, we need to go for it, we can't put off until tomorrow what can be done today.'"
The rider from team Burgos-BH had stayed near the front throughout the final kilometers (miles) in a breakaway group that included teammate Jetse Bol and José Herrada of team Cofidis. Bol crossed the line in second place, 10 seconds off the lead, with Herrada coming in 12 seconds later.
"I wanted to win myself, but when a teammate wins, and it happens the way it did, it just feels incredible," Bol said. "Madrazo was dropping and coming back the whole time but when he attacked he was gone for good. It was impressive."
Lopez, a Colombian from Astana Pro Team, finished fourth in the stage, 47 seconds behind Madrazo. Alejandro Valverde, of Movistar Team, was fifth. Lopez and Valverde had been about seven minutes behind the breakaway group entering the final climb but cut most of the gap.
Lopez opened a 14-second gap to Jumbo-Visma rider Primoz Roglic in the overall standings. Nairo Quintana of Movistar Team was 23 seconds off the lead, while Valverde trailed by 28 seconds in fourth place. Irish rider Nicolas Roche, who held the leader's red jersey entering Wednesday's stage, fell to fifth place overall, 57 second behind Lopez.
"We've only won a few seconds but that's already something," Lopez said. "There's a lot of racing left but so far everything is going great for us. There'll be more differences opening in the next days."
Thursday's sixth stage will take riders nearly 200 kilometers (124 miles) from Mora de Rubielos to another mountain-top finish in Ares del Maestrat.
More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports