After three consecutive losses at Camp Nou, Barcelona were desperate to return to winning ways.
Rivals Madrid defeated Espanyol to claim the 2021/22 La Liga title as Barcelona are still on the hunt for Champions League football next season.
Barcelona started well and were rewarded in the 25th minute when Memphis Depay connected with a long ball to him by Jordi Alba to give them a lead to the halftime break.
In the 54th minute, Barcelona got their second of the game when captain Sergio Busquets pounced on a rebound.
With a two goal advantage Barcelona boss Xavi Hernandez decided to bring on Ansu Fati.
The 19-year-old replaced Ferran Torres to take part in his first game since January.
Shortly after the introduction of Fati, Antonio Raillo was assisted by Salva Sevilla to pull one back for Mallorca.
Barcelona would hold on to get all three points as they continue their aim to secure Champions League football.
Reactions as Ansu Fati returns for Barcelona against Mallorca
Speaking after the game, Barcelona boss Xavi said, “I am happy that Ansu Fati is back. Everyone did a great job.
"We have two goals. The first is to get into the Champions League, which also provides financial funds. Then, of course, win the rest of the remaining games this season."
Goalscorer Depay was also ecstatic about the win and the return of Ansu for the team.
He said, "I came here with the desire to play for the team. I want to be important in the team for next year and for several more years.
ALSO READ - Barcelona stars enjoy barbeque at La Masia ahead of Mallorca clash
"Ansu is a special and happy boy. I'm very happy to see him return. It's important for him and his family.
"We have to take care of him because he is a special talent, and with time he will come back."
With Barcelona out of the Europa League, Xavi's team have no midweek and return to action against Champions League contenders Real Betis on Sunday, May 7, 2022.