It’s the third time lucky for FC Barcelona in the UEFA Champions League as the Catalans finally won a game in the competition as they beat Ukrainian club Dynamo Kyiv 1-0 at Camp Nou on Wednesday.

German champions Bayern Munich handed Ronald Koeman’s Barcelona their first defeat in the Catalan giant’s post-Lionel Messi era when they defeated them 3-0 at Camp Nou in the Champions League opener last month. They were then handed another defeat by the same margin on matchday two by Portuguese club Benfica. Barcelona had never lost more than two group-stage games since 1997-98.

Gerard Pique scored the lone goal for Barcelona to give them their first Champions League win of the season. It is also the first time that the Catalans have won in the tournament since Lionel Messi left the club for PSG.

The victory put the Catalan club in third place in Group E, two points in front of Dynamo and one behind Benfica, which hosts leader Bayern later Wednesday.

It was Barcelona’s second win in a row after it had won only once in six matches in all competitions.

It had been winless in five straight Champions League games, its longest run without a win since 1997. It had lost its last three Champions League matches at home for its worst streak ever in the European competition.

Piqué opened the scoring with a one-timer from close range after a cross by Jordi Alba across the area in the 36th minute, joining former Real Madrid left-back Roberto Carlos as the top-scoring defender in the Champions League. Piqué had been tied with former Madrid central defenders Sergio Ramos and Iván Helguera with 15 goals.

The 34-year-old Piqué also became the oldest Champions League scorer for the Catalan club, surpassing Sylvinho, who netted against Shakhtar Donetsk in 2008.

Striker Sergio Aguero came off the bench in the 75th minute to replace Memphis Depay and make his second appearance with Barcelona since joining the club from Manchester City this season.

Dynamo had opened with a home draw against Benfica before losing 5-0 at Bayern in a result that equaled its heaviest defeat in a UEFA club competition.

Barcelona’s next match is the Spanish league “clásico” against Real Madrid at Camp Nou on Sunday.

(With AP inputs)