Lionel Messi opened the scoring to lead Barcelona to a 5-1 win over Hungarian club Ferencváros on Tuesday in its first Champions League match since the embarrassing 8-2 loss to Bayern Munich last season.

Ansu Fati, Philippe Coutinho, Pedri and Ousmane Dembélé also scored to give Barcelona the opening victory in Group G. Ihor Kharatin scored Ferencváros' lone goal from a penalty that led to a straight red card to Barcelona defender Gerard Piqué with about 20 minutes left.

More Images
Barcelona's Lionel Messi, center, is stopped by Ferencvaros players during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Lionel Messi opened the scoring to lead Barcelona to a 5-1 win over Hungarian club Ferencváros on Tuesday in its first Champions League match since the embarrassing 8-2 loss to Bayern Munich last season.

Barcelona's Lionel Messi controls the ball during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona, trying to win its first Champions League title since 2015, was trounced by Bayern in August during last season's quarterfinals. The loss capped the Catalan club's first season without a title since 2007-08. It has been mired in crisis since then, with Messi being forced to stay despite wanting to leave, and with former player Ronald Koeman taking over the coaching job with the task of revamping the squad.

Barcelona's head coach Ronald Koeman gives directions to his players during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Substitute Pedri scored from close range in the 82nd in his Champions League debut, and Dembélé came off the bench to seal the scoring in the 89th for his first goal with Barcelona in more than a year.

Barcelona's Ansu Fati scores his side's second goal during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

American defender Sergiño Gest and Portuguese forward Francisco Trincão started for Barcelona, while Antoine Griezmann and Sergio Busquets were kept on the bench.

Barcelona players celebrate the second goal of their team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports

Barcelona's Ansu Fati, left, celebrates with teammate Francisco Trincao after scoring the second goal of his team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona's Ansu Fati, left, celebrates with teammate Francisco Trincao after scoring the second goal of his team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona players celebrate the opening goal of their team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona players celebrate the opening goal of their team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

In the other group match, Juventus won 2-0 at Dynamo Kyiv with a pair of goals by striker Álvaro Morata.

Barcelona's Lionel Messi, center, is stopped by Ferencvaros players during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona's Lionel Messi, center, is stopped by Ferencvaros players during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona, trying to win its first Champions League title since 2015, was trounced by Bayern in August during last season's quarterfinals. The loss capped the Catalan club's first season without a title since 2007-08. It has been mired in crisis since then, with Messi being forced to stay despite wanting to leave, and with former player Ronald Koeman taking over the coaching job with the task of revamping the squad.

Messi opened the scoring by converting a 27th-minute penalty kick after being brought down by a defender inside the area. It was his second goal of the season in all competitions. It extended his run with at least a goal in the Champions League to 16 consecutive seasons. He has a total 116 goals in the top European club competition.

The 17-year-old Fati added to the lead with a nice touch from close range in the 42nd after a well-placed pass by Frenkie de Jong, then set up Coutinho’s goal with a neat back-flick pass in the 52nd. Coutinho was on a loan with Bayern last season and scored twice for the German club in the 8-2 win over Barcelona in Lisbon.

Barcelona's Lionel Messi controls the ball during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona's Lionel Messi controls the ball during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Substitute Pedri scored from close range in the 82nd in his Champions League debut, and Dembélé came off the bench to seal the scoring in the 89th for his first goal with Barcelona in more than a year.

Barcelona survived an early scare as Ferencváros scored in the 10th, but the goal was disallowed for an offside by Tokmac Nguen. The visitors were denied by the woodwork 10 minutes later on a shot by forward Isael.

Barcelona got the win despite playing a man down from the 68th as Piqué was sent off for bringing down Tokmac Nguen inside the area to stop a counterattack. Piqué will miss Barcelona’s visit to Juventus next week.

Barcelona's head coach Ronald Koeman gives directions to his players during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona's head coach Ronald Koeman gives directions to his players during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

American defender Sergiño Gest and Portuguese forward Francisco Trincão started for Barcelona, while Antoine Griezmann and Sergio Busquets were kept on the bench.

Barcelona hosts Real Madrid on Saturday in the first Spanish league “clásico” of the season.

Ferencváros is back in the Champions League for the first time since 1995, having gotten past four qualifying rounds to reach the group stage.

Barcelona's Ansu Fati scores his side's second goal during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona's Ansu Fati scores his side's second goal during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports

Barcelona players celebrate the second goal of their team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona players celebrate the second goal of their team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona's Ansu Fati, left, celebrates with teammate Francisco Trincao after scoring the second goal of his team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona's Ansu Fati, left, celebrates with teammate Francisco Trincao after scoring the second goal of his team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona players celebrate the opening goal of their team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)

Barcelona players celebrate the opening goal of their team during the Champions League group G soccer match between FC Barcelona and Ferencvaros at the Camp Nou stadium in Barcelona, Spain, Tuesday, Oct. 20, 2020. (AP PhotoJoan Monfort)