Spain produced a super display to outclass a Ukraine side that played most of the second half with 10 men.
Spain put on a stunning show in the Liepzig sunshine
Xabi Alonso headed Spain in front from a Xavi corner and David Villa doubled the lead with a free-kick that deflected past Olexandr Shovkovskiy.
Vladislav Vashchuk was sent off for pulling back Fernando Torres and Villa added a third goal from the penalty.
Spain saved their best for last when Fernando Torres finished off a sublime move by drilling home.
It was a harsh welcome to the finals for World Cup new boys Ukraine who struggled as the temperatures again hit the 30C mark as the German heat-wave continued.
Spain wasted no time in going straight at the debutants, with Torres and Villa showing why they were preferred up front to skipper Raul.
The Ukraine defence looked like they did not know what had hit them as the front pair's direct running put them firmly on the back foot.
Ukraine had already suffered a few scares when Alonso put Spain in front with his first international goal.
Whether the ball came off his head or his shoulder was up for debate, but the way Spain celebrated indicated they were not too worried about the aesthetics of the goal.
Four minutes later Ukraine's woes worsened when Villa's free-kick clipped the head of Andriy Rusol in the wall and deflected past Shovkovskiy.
Rather than taking their foot off the gas, Spain were like a rampaging bull as the red shirts poured forward.
At the other end little was going right for Ukraine.
Andriy Shevchenko had given them a boost by being passed fit to start, but he was rarely a threat and one of his rare ventures into the Spanish area saw him tread on the ball.
It took them 32 minutes to register a shot on goal, and even then it was a scuffed effort from Andriy Gusin that was easily gathered by Iker Casillas.
Ukraine made two changes at the break but any hope of their new arrivals helping them change things around ended when Vashchuk was harshly dismissed.
The impressive Villa scored two of Spain's goals
The defender battled back to try and prevent Torres from a clean strike on goal, but Swiss referee Massimo Busacca adjudged he had pulled Torres back and issued a red card and a penalty.
Villa stepped up to score from the spot and the three points were effectively Spain's.
The Ukraine battled on bravely with Andriy Voronin volleying just wide and substitute Serhiy Rebrov lashing their best chance of the game over the bar.
But the last word fell to Spain, with Carles Puyol starting off a fantastic move from his own half.
He carried on running and when the ball was played forward he headed into the path of Torres to drive home from the edge of the area.
It capped off a thoroughly impressive performance from a country who so often fail to deliver at the World Cup finals.
Spain: Casillas, Pernia, Puyol, Sergio Ramos, Pablo, Xavi, Alonso (Albelda 55), Senna, Luis Garcia (Fabregas 77), Villa (Raul 55), Torres.
Subs Not Used: Antonio Lopez, Canizares, Iniesta, Joaquin, Juanito, Marchena, Reina, Reyes, Salgado.
Goals: Alonso 13, Villa 17, 48 pen, Torres 81.
Ukraine: Shovkovskiy, Nesmachniy, Yezerskiy, Rusol, Vashchuk, Tymoschuk, Gusev (Shelayev 45), Gusin (Vorobey 45), Rotan (Rebrov 63), Shevchenko, Voronin.
Subs Not Used: Byelik, Chigrynskiy, Kalinichenko, Milevskiy, Nazarenko, Pyatov, Shust, Sviderskiy, Yatsenko.
Sent Off: Vashchuk (47).
Booked: Rusol, Yezerskiy.
Ref: Massimo Busacca (Switzerland).
Fifa man of the match: Xavi.
Ukraine's 4-0 loss to Spain equalled their heaviest ever defeat. Ukraine had lost by a four-goal margin only once before against Croatia in a European Championship qualifier on 25 March 1995. But this Group H match was not Spain's biggest ever victory at the World Cup as they crushed Bulgaria 6-1 on 24 June 1998.
The eclipse of Ukraine took Spain's unbeaten run to 23 games, since their 1-0 loss to Portugal in Euro 2004. Spain are now also unbeaten in eight World Cup matches, winning five and drawing three. They hold the longest current unbeaten streak with Brazil who also hold the all-time record of 13 between 1958 and 1966.
Cesc Fabregas and Sergio Ramos became the two youngest ever Spanish players at the World Cup. Fabregas (19 years, 41 days) and Ramos (20 years and 76 days) both broke the Spanish record.
The red card shown to Vladislav Vashchuk was the third of this tournament, and the first straight red.
The penalty scored by David Villa was the first spot-kick awarded during the 2006 World Cup. It took 15 matches before the first penalty was given, and has only taken longer once previously in 1974, when Johan Neeskens converted the first spot-kick during the 21st match.