Andres Iniesta's illustrious Barcelona career came to an end with a 1-0 win over Real Sociedad at a Camp Nou in celebratory mood.

The 34-year-old had announced in April that he would leave the Catalan giants at the end of the season – just two days before Ernesto Valverde's side beat Deportivo La Coruna to confirm a 25th LaLiga title.

Played out against that backdrop it was hardly surprising that at times it felt more like a testimonial match rather than the final league game of the season.

Iniesta demonstrated his abundant repertoire in a dominant first-half display, finding his team-mates with an array of precise and inventive passing, something he has done with distinction since his debut in the 2002-03 season.

While the World Cup winner was not involved in the game's solitary goal, he will have looked on admiringly as Philippe Coutinho whipped in a fine finish from outside the area after 57 minutes.

The curtain eventually came down on Iniesta’s time with Barca in the 81st minute, the midfielder leaving the field to a rapturous reception and handing over the captain’s armband to Lionel Messi in a symbolic gesture.

In a bright, open start it was the visitors who carved out the first clear sight of goal, Willian Jose heading straight at Marc-Andre ter Stegen from Adnan Januzaj's clipped cross.

The Belgian winger then tested Barca's goalkeeper himself soon after with a whipped effort from outside the penalty area before Iniesta came close to a fairytale goal – his low strike flashing past Miguel Angel Moya's right-hand post and into the side netting.

A rejuvenated Ousmane Dembele then delivered two fine crosses in quick succession that should have resulted in an opener. First, an unmarked Ivan Rakitic failed to locate the target with a header from 10 yards and then Luis Suarez scuffed a shot wide from the Frenchman's low ball into the box.

Sociedad were fortunate not to be reduced to 10 men moments before the interval when Raul Navas hacked down a marauding Dembele on the right, referee Jose Luis Munuera Montero opting to give the defender just a yellow card.

Barca started the second period with a spring in their step and were rewarded with a goal of the highest calibre from Coutinho.

The Brazilian – who netted a hat-trick in last weekend’s remarkable 5-4 defeat to Levante, a result that ended Barca's unbeaten record in the league this term – cut in from the left and unleashed a trademark curled finish from 25 yards that crashed in off Moya's left-hand post.

Messi almost set up a second minutes after his introduction, only for fellow substitute Denis Suarez to shoot too close to Moya, while the Argentine forward could not direct a header beyond the Sociedad goalkeeper from Luis Suarez's cross. 

Iniesta’s long goodbye finally came to an end nine minutes from time when he was replaced by Paco Alcacer, while there was also time for Sociedad to pay tribute to their own legendary midfielder Xabi Prieto, the 34-year-old coming on for the final few minutes ahead of his retirement at the end of the campaign.