Costa Rica simply had to answer to Spain's pace, movement off the ball and passing and the Spaniards cruised to victory with over 80 percent of the ball, while their rivals failed to have a simple shot, either on or off target in the entire match.
Ferran Torres scored twice, while Dani Olmo, Marcos Asensio and Gavi also found the Costa Rican net, with Gavi making history in the process.
Spain coach Luis Enrique had a few surprises in his starting 11, with Marco Asensio in for Alvaro Morata in attack, while Cesar Azpilicueta started at right back and midfielder Rodri Hernandez partnered Aymeric Laporte in central defense.
It was obvious the Spanish would look to control the ball, while their rivals would defend and try to play on the break.
However, Costa Rica struggled to deal with a Spain side with Sergio Busquets moving the ball at will in midfield, with everyone moving to create spaces.
Olmo volleyed wide from a Jordi Alba pass after four minutes when he could have done better, but then produced a moment of magic to connect with Pedri, turning and flicking the ball over Keylor Navas to open the scoring in the 11th minute.
Asensio, who had earlier fired just wide, doubled Spain's lead in the 21st minute when Jordi Alba was given space on the left. Nobody picked out Asensio's run and he scored with a left-foot shot.
With Busquets enjoying a virtual stroll in the park, Spain had 80 percent of possession and with the Costa Ricans chasing shadows, it was no surprise when Oscar Duarte clipped Alba's heel in the 31st minute, allowing Ferran Torres to score the third from the penalty spot calmly.
Asensio should have added a fourth in the injury time of the first half, but sliced wide and he fired over after a strong run by Azpilicueta at the start of the second.
In the end, Torres scored the fourth in the 54th minute when he was able to turn and send the ball under Navas from a tight angle with the Costa Rica defense mere spectators.
He was replaced straight after by Alvaro Morata, with Carlos Soler also on for Pedri. Alejandro Balde made his Spain debut when he replaced his Barca teammate Alba 10 minutes later, as Koke took over from Busquets and Nico Williams came on for Asensio.
Gavi volleyed in the fifth in the 74th minute to become the youngest Spanish player to score in the World Cup finals at 18 years and 110 days, and the youngest to do so since a 17-year-old Pele did it in 1958.
There was still time for Williams to set up Carlos Soler for the sixth, while Morata added number seven from close range in injury time.