A superbly taken last-gasp strike by midfielder Guti earned Real Madrid a 2-1 win at home to third division Alicante that took them into the last 16 of the King's Cup on Wednesday.
Real, who scrambled a late 1-1 draw in last month's first leg, took the lead when Dutch winger Arjen Robben cracked home on the half-volley to score his first goal for the club just after the half hour.
But an ambitious Alicante refused to wilt and equalised 20 minutes into the second half when striker Borja steered a near-post header low past keeper Jerzy Dudek after Alvaro had clipped in a great cross from the right.
With just seconds of stoppage time left on the clock, the game looked certain to be heading for extra time, but Guti took advantage and sent a perfectly measured shot curling over the keeper and into the net.
Arch-rivals Barcelona secured their place in the last 16 despite being held to a 2-2 draw by third division Alcoyano at the Nou Camp.
Barca, who held a comfortable 3-0 advantage after the first leg, put the result of the tie beyond doubt when reserve forward Santiago Ezquerro struck twice in the first 11 minutes.
But a penalty from Perona and a last-minute strike from Arnau earned their modest opponents a rare draw at the Barcelona stadium.
Last year's losing finalists Getafe cruised into the last 16 after a 4-1 win at home to Burgos earned them an emphatic 5-1 victory on aggregate over their third division opponents.