Gavi announced himself on the global stage with a brilliant volley as Spain produced a sparkling passing performance to outclass Costa Rica and start their World Cup in sensational style.
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.
It was an ominous start for Costa Rica and things quickly got worse for the 2014 quarter-finalists, who were the last team to qualify for Qatar.
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.
But there was more misery to come for Costa Rica after the break, with Spain still hungry for goals.
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.Follow live coverage of Spain v Costa RicaFifa World Cup: Groups & ScheduleWorld Cup TV Coverage guide
Spain's youngsters produce dazzling display
Gavi is the youngest man to play for Spain at a World Cup and his goal made him the youngest goalscorer at a finals since Brazilian Pele in 1958.
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.
Costa Rica were barely allowed a kick, managing only 231 passes to 1,043 from Spain, and failing to register a single effort at goal.
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.
How to play
Rate players out of 10 throughout or after the game. The rater will close 30 minutes after the final whistle.
Rating range key1 = Give it up10 = Pure perfection
Squad number23Player nameSimón
Squad number2Player nameAzpilicueta
Squad number16Player nameRodri
Squad number24Player nameLaporte
Squad number18Player nameAlba
Squad number9Player nameGavi
Squad number5Player nameBusquets
Squad number26Player namePedri
Squad number11Player nameF Torres
Squad number10Player nameAsensio
Squad number21Player nameOlmo
Squad number7Player nameMorata
Squad number8Player nameKoke
Squad number12Player nameNico Williams
Squad number14Player nameBalde
Squad number19Player nameSoler
Squad number1Player nameNavas
Squad number16Player nameMartínez
Squad number6Player nameDuarte
Squad number15Player nameCalvo
Squad number8Player nameOviedo
Squad number4Player nameFuller
Squad number5Player nameBorges
Squad number17Player nameTejeda
Squad number9Player nameBennette
Squad number12Player nameCampbell
Squad number7Player nameContreras
Squad number10Player nameRuiz
Squad number19Player nameWaston
Squad number20Player nameAguilera
Squad number22Player nameMatarrita
Squad number26Player nameZamora
Formation 4-3-323Simón2Azpilicueta16Rodri24Laporte18AlbaSubstituted forBaldeat 64'minutes9Gavi5BusquetsSubstituted forKokeat 64'minutes26PedriSubstituted forSolerat 57'minutes11F TorresSubstituted forMorataat 57'minutes10AsensioSubstituted forWilliams Arthuerat 69'minutes21Olmo
Substitutes1Sánchez3García4P Torres6Llorente7Morata8Koke12Williams Arthuer13Raya14Balde15Guillamón17Pino19Soler20Carvajal22Sarabia25Ansu Fati
Formation 4-4-21Navas16MartínezSubstituted forWastonat 45'minutes6Duarte15CalvoBooked at 68mins8OviedoSubstituted forMatarritaat 82'minutes4Fuller5BorgesSubstituted forAguileraat 72'minutes17Tejeda9BennetteSubstituted forRuizat 61'minutes12CampbellBooked at 90mins7ContrerasSubstituted forZamoraat 61'minutes
Referee:Mohammed Abdulla Hassan
Match ends, Spain 7, Costa Rica 0.
Second Half ends, Spain 7, Costa Rica 0.
Attempt blocked. Carlos Soler (Spain) right footed shot from a difficult angle and long range on the left is blocked.
Joel Campbell (Costa Rica) is shown the yellow card for a bad foul.
Alejandro Balde (Spain) wins a free kick on the left wing.
Foul by Joel Campbell (Costa Rica).
Attempt missed. Carlos Soler (Spain) right footed shot from the centre of the box misses to the right. Assisted by Gavi.
Gavi (Spain) wins a free kick on the right wing.
Foul by Brandon Aguilera (Costa Rica).
Goal! Spain 7, Costa Rica 0. Álvaro Morata (Spain) left footed shot from the centre of the box to the bottom left corner. Assisted by Dani Olmo.
Foul by César Azpilicueta (Spain).
Ronald Matarrita (Costa Rica) wins a free kick in the defensive half.
Goal! Spain 6, Costa Rica 0. Carlos Soler (Spain) right footed shot from the centre of the box to the bottom right corner.
Foul by Aymeric Laporte (Spain).
Joel Campbell (Costa Rica) wins a free kick in the defensive half.
Gavi (Spain) wins a free kick in the attacking half.
Foul by Brandon Aguilera (Costa Rica).
Hand ball by César Azpilicueta (Spain).
Substitution, Costa Rica. Ronald Matarrita replaces Bryan Oviedo.
Offside, Spain. Koke tries a through ball, but Álvaro Morata is caught offside.
Get your daily dose of Fifa World Cup reaction, debate & analysis with World Cup Daily on BBC Sounds