European champions Spain set a world record of 15 successive international wins by beating South Africa 2-0 in the Confederations Cup on Saturday.
David Villa's goal seven minutes into the second half and another 20 minutes later from substitute Fernando Llorente also meant Spain equalled Brazil's run of 35 matches without defeat.
Runners-up South Africa joined Group A winners Spain in the semi-finals after Iraq drew 0-0 with New Zealand in Johannesburg, the home players waiting anxiously in a huddle on the pitch before discovering their fate.
Villa's goal was a masterclass in control and finishing as he chested down a chip from Alvaro Arbeloa before turning and shooting wide of Itumeleng Khune.
The 21-year-old keeper had brought the 38,212 crowd to its feet less than a minute earlier, stopping the Valencia player's penalty and a follow-up shot from Carles Puyol.
The kick had been awarded after Villa was brought down by South Africa captain Aaron Mokoena.
Villa and strike partner Fernando Torres were replaced immediately after the first goal as coach Vicente del Bosque gave opportunities to Pablo Hernandez and Llorente.
Llorente swept in the second goal after a miscue from Cesc Fabregas fell perfectly in his path, enabling Spain to break the previous record for successive international victories jointly held by Brazil, France and Australia.
South Africa toiled hard but were no match for Spain, who coasted after the second goal.
HALF CHANCES
There were half chances for the hosts, the best from Bernard Parker whose 84th-minute shot was saved by Pepe Reina.
The best opportunities in a goalless first half came from set-pieces and quick breakaways.
Khune had an early confidence boost when he palmed over a stinging free kick from Albert Riera in the third minute and then watched three minutes later when Villa's header sailed over the crossbar.
The home side produced their first attempt on goal after 18 minutes when Teko Modise went wide with a free kick.
He came even closer with a scuffed shot after a breakaway by Steven Pienaar before Parker hurried a similar chance.
An outstretched hand from Khune denied Torres in the 35th minute while Villa shot tamely over seven minutes later.
Spain, the world's top-ranked team, remain in Bloemfontein for Wednesday's semi-final against the runners-up in Group B while South Africa play in Johannesburg on Thursday.
Group B will be decided on Sunday when Brazil meet Italy and Egypt take on the U.S.