Ferran Torres scored twice in what was a stroll from start to finish for the 2010 champions.
But the pick of their seven goals was Gavi’s outstanding volleyed finish, with the Barcelona teenager using the outside of his foot to steer a dropping ball home via the post and become the youngest World Cup goalscorer since Pele.
This has been a tournament full of surprises, with Spain’s Group E rivals Germany the latest victims with their late defeat by Japan earlier on Wednesday, but there was never a hint of another shock happening here.
La Roja were completely dominant from the start, with Costa Rica unable to live with their pace, movement and precision when they came forward.
The Euro 2020 semi-finalists went close twice in the first 10 minutes, with Dani Olmo and Marco Asensio both firing wide, but they did not have to wait long to take the lead.
Olmo had work to do to when he met Gavi’s delicate chipped pass into the area, but he used his strength to hold off Oscar Duarte then span into space to expertly slot past the onrushing Keylor Navas.
Again Spain advanced up the middle of the pitch unopposed, before the ball was spread left to Jordi Alba and his driven cross was met powerfully by Asensio – although Navas should have done far better with his attempted save.
Victory was sealed just after the half-hour mark, when Torres sent Navas the wrong way from the spot after Duarte had hacked at Alba in the box.
Torres capitalised on more poor defending to make it 4-0, collecting a loose ball after bursting into the box and then calmly firing home.
Gavi’s superb strike added gloss to an already glittering display, with the 18-year-old finding a finish to match his impressive performance after meeting a cross from substitute Alvaro Morata.
Another substitute, Carlos Soler, made it six after Navas failed to deal with a cross, and Morata rounded off the scoring in injury time after playing a one-two with Olmo.
Spain’s youngsters produce dazzling display
The way he took it was worthy of the legend mentioned in that statistic, and capped a display which was mature beyond his years.
He was not the only young Spanish player to dazzle either, with 19-year-old Pedri also enjoying an outstanding evening in midfield.
Spain had lost their opening matches at the past three World Cups, including in 2010 when they went on to win the tournament.
This time, they could not have made a more emphatic start, and will be in confident mood when they face Germany in their next game, knowing another win would all but eliminate their great European rivals.