Sergio Ramos missed two penalties as Spain needed a late equaliser from Gerard Moreno to draw 1-1 with Switzerland in the Nations League on Saturday.
Ramos was making his 177th appearance for Spain to become the most capped European player in history, pulling clear of Italy's Gianluigi Buffon, who has 176.
But instead of a celebration in Basel, it was a night to forget for the defender, who saw one spot-kick saved by Swiss goalkeeper Yann Sommer but backed himself to score a second, only to miss again with a dreadful attempted 'Panenka'.
Spain coach Luis Enrique defended his captain after the game.
"Sergio's numbers for penalties are out of this world," he said. "If there had been a third penalty, he would have taken that one as well."
Ramos had previously scored 25 penalties in a row and his inaccuracy from the spot cost Spain, who will now have to beat Germany in Sevilla on Tuesday to reach the final four.
"We wanted to win here and the team tried until the end," said Moreno. "It wasn't to be but it's still in our hands to get through, even if we have a difficult game."
Enrique's side have only scored three times in their last five matches and they struggled again to break through against a well-organised Switzerland, who led through Remo Freuler and also had Nico Elvedi sent off with 11 minutes left.
Spain's press was beaten too easily for the first goal as Switzerland counter-attacked at speed.
With Ramos out of position, Breel Embolo raced in behind before pulling a cross back to Freuler, who opened up his left foot and skewed the ball brilliantly into the far corner.
Ferran Torres could have equalised on the stroke of half-time but fired over at the back post before Ramos began his frantic half an hour.
First, he brilliantly blocked Freuler's shot on the line after Unai Simon made a mess of rushing out and then the Spain captain won the first penalty, his header hitting the arm of Sergio Rodriguez, who had turned his back.
But Ramos was unable to convert, his shot well saved by Sommer, who refused to commit too soon and got down quickly to his right.
Twenty minutes later, Alvaro Morata was fouled by Elvedi and Ramos stepped up to make amends, only to compound his earlier error by missing again, this time with an attempted chip that Sommer easily collected.
Spain finally found an equaliser in the 89th minute as Moreno capitalised on a tiring Swiss defence by converting Sergio Reguilon's cross. But Switzerland held on for a point.
Basel, Switzerland | AFP