Saudi Arabia 0 Spain 1
Juanito's first-half header gave Spain a narrow victory against Saudi Arabia which allowed them to finish top of Group H.
The Betis defender latched on to Jose Antonio Reyes' free-kick to give his side, completely changed from their last match, a 36th-minute lead.
Spain were far superior but wasted a hatful of chances and survived several late scares.
Spain began in confident fashion and might have taken an early lead had Raul's header from Antonio Lopez's dangerous cross not gone wide.
Paqueta was forced to make his first substitution in the 12th minute with Nawaf Al Temyat replacing injured Khaled Aziz.
The Saudis struggled break down Spain's second string defence.
With 16th minutes played Joaquin's powerful strike from the edge of the area went high over the crossbar.
Seconds later Joaquin found Reyes at the far post, who dribbled past his marker before firing on target only for his effort to be saved by goalkeeper Mabrouk Zaid.
Midway though the first half Reyes tried his luck from the distance and his effort fizzed wide.
The Saudis struggled to find their stride and continuously made unforced errors which only benefited their opponents.
Shortly before the half-hour mark David Albelda and Joaquin warmed the hands of Zaid with two stinging drives which goalkeeper did well to palm over.
Raul almost caught Zaid off guard with his 30-yard lob going high over the crossbar, much to the relief of the Saudi supporters at the Fritz-Walter Stadion.
In the 34th minute Reyes was booked for a late challenge on Sami Al Jaber but all was forgiven as the Arsenal forward acted as provider for Spain's opener.
His curled free-kick found Juanito inside the box and his powerful header beat Zaid.
Mohammed Noor should have equalised seconds later but his weak strike proved an easy catch for goalkeeper Santiago Canizares, in what was his first save of the afternoon.
Spain could easily have gone into the break with a four-goal advantage but Zaid stood strong to twice deny Reyes and Fabregas' close-range efforts.
Aragones made his first substitution after the re-start with striker David Villa replacing Raul.
Spain continued to miss clear-cut chances, with Andres Iniesta and Reyes failing to find the target from close range.
In the 53rd minute, Zaid was forced to stretch to clear Antonio Lopez's right-footed effort.
Canizares was tested by Hussein Sulimani's powerful central strike as the Saudis looked more lively.
At the other end, Joaquin fired wide and was later denied this time by the ever-present Zaid.
Shortly after the hour mark, Xavi and Fernando Torres entered the pitch replacing Fabregas and Reyes.
Sulimani should have equalised in the 68th minute but his angled strike went inches wide of Canizares' near post.
With their rivals failing to punish them, the Saudis pressed forward more aggressively in search of the equaliser.
With 10 minutes remaining Sulimani's free-kick went high over the crossbar and substitute Mohammed Massad almost stunned Canizares with his near-post effort which forced the keeper into a fine save.
Saudi Arabia twice had the chance to equalise, with Saad Al Harthy's close-range effort finding the stands and Al Temyat's angled strike going inches wide of the far post, but time eventually ran out.