BARCELONA, Spain — Barcelona defeated Borussia Moenchengladbach 4-0 to match the 20-goal scoring record in the group stage of the Champions League, but Lionel Messi fell short of equaling Cristiano Ronaldo's 11-goal mark in the first phase of the tournament.

Messi's 10th goal and Arda Turan's hat trick helped Barcelona reach the 20 goals in this season's group stage, a feat achieved only three other times in the past, including by the Catalan club in 2011-12.

Real Madrid did it in 2013-14 and Manchester United in 1998-99. Borussia Dortmund needs one goal in its game against Madrid on Wednesday in Spain to match the record.

All Group C positions had already been decided ahead of Tuesday's final round. Barcelona finished with 15 points, six more than Manchester City, which drew 1-1 with Celtic in England. Moenchengladbach ended third with five points, two more than winless Celtic.

"The team played well the entire match," Barcelona coach Luis Enrique said. "The players were quick and precise. I congratulate them."

Messi scored in the 16th minute at Camp Nou after a one-two with Turan inside the Moenchengladbach area. The Argentine slid behind the defenders and fired home a low left-foot shot after receiving Turan's return pass.

Messi had a great chance to match Ronaldo's record in the 73rd, but his close-range header was brilliantly saved on the line by goalkeeper Yann Sommer.

Turan scored in the 50th, 53rd and 67th minutes to help the Catalan club end a three-game winless streak. It conceded a 90th-minute equalizer in a 1-1 home draw against Real Madrid in the Spanish league on Saturday.

According to UEFA's statistics, Barcelona made a whopping 1,022 passing attempts on Tuesday, completing 939 of them.

"Barcelona were very Barcelona-esque," Moenchengladbach coach Andre Schubert said. "We had too much respect for them and didn't play with enough courage."

Barcelona was without forward Neymar and midfielder Ivan Rakitic because of suspensions.

Luis Enrique also rested striker Luis Suarez, giving a chance to recently signed forward Paco Alcacer, who has been criticized by Barcelona fans for his lacklustre performances.

Ronaldo scored 11 goals last year became the first player to reach double figures in the six games of the group stage. Messi played in only five matches for Barcelona this season, but he twice scored hat tricks — in the home games against Celtic and Manchester City. He also netted once against City in Manchester and twice against Celtic in Glasgow.

Ronaldo on Wednesday will try to become the first player to score 100 goals in European competitions. He is two short of the milestone heading into the game against Borussia Dortmund at the Santiago Bernabeu Stadium.

Messi now has 93 goals overall in the Champions League, two less than Ronaldo.