The Catalan giants won the El Clasico 3-1 and went on to lift the trophy after the scuffle.
Los Blancos found themselves 3-0 down, and in an attempt to change the game, manager Carlo Ancelotti subbed on midfielder Ceballos with 25 minutes left.
In the latter stages of the match, the clearly frustrated ex-Arsenal midfielder started an altercation by tugging Gavi back by the hair.
The ball was being held by the 18-year-old as he went to complain to the referee, only for Ceballos to grab him by the top of his head and yank him back.
Gavi reacted by pushing the Real Madrid man, which led to team-mate Robert Lewandowski feeling he had to step in to calm things down.
Vinicius Junior then tried to confront the teenager being protected by the Polish striker as he shouted back at his opponent.
The whole incident went unpunished with both Ceballos and Gavi only receiving warnings.
However, Barca defender Ronald Araujo demanded action, charging up to the official to signal that Gavi had just had his hair pulled.
In the end, it was Barcelona who had the last laugh over their bitter rivals as they secured the first trophy of the season.
HOW TO GET FREE BETS ON FOOTBALL
Goals from Pedri, Lewandowski and Gavi himself were the difference as Karim Benzema also scored a consolation in the last minute.
Strangely, this is not the first time a Barca player has been involved in a barnet pulling incident in recent weeks.
Earlier this month in their LaLiga clash with Atletico Madrid, Ferran Torres and Stefan Savic were both sent off for fighting.
Torres and Savic ended up wrestling on the floor with the Spanish attacker getting a grip of the Atleti defender’s hair.