Porto: With a convincing performance at home, Porto beat Leipzig 3-1 to gain revenge on their German rivals and move into second place in Group G of the Champions League on Wednesday.

Leipzig had beaten Porto 3-2 two weeks ago.

In Porto, Hector Herrera put the hosts ahead with a shot from inside the area early in the first half before Timo Werner came off the bench to equalise for Leipzig just after half-time.

Danilo put Porto back in front from close range after a free kick later in the second half and Maxi Pereira grabbed the third in injury time, leaving the 2004 champions in good position to advance to the knockout stage for the second straight season.

“In the first game in Germany, Leipzig surprised us as they were a team we didn’t know very well,” Herrera said. “Tonight we were better positioned and closed a lot of spaces.”

“It was a strong game from us,” Porto coach Sergio Conceicao said. “We worked well as a unit and didn’t suffer as we did in Germany in the first meeting. We nullified our opponent’s strengths for large parts.”

Porto are on six points from four matches, two points more than Leipzig but four fewer than Besiktas — held 1-1 by Monaco in Turkey in the group’s other game Wednesday. Last-place Monaco have two points.

Danilo appeared to be offside when he scored Porto’s second goal at the Estadio do Dragao.

Werner surprisingly didn’t make the starting line-up for Leipzig, but the 21-year-old German international made an impact as soon as he came on with a shot over goalkeeper Jose Sa from just inside the area for the equaliser.

“It was an even contest,” Leipzig defender Bernardo said. “The final score of 3-1 isn’t a good reflection of the match as a whole. Things are still very much open [in the group]. We believe we are as good as our opponents and we’re going to fight to get through.”

Porto, who had lost four straight games against German clubs, lost Moussa Marega to injury in the 12th minute.

Porto next play at Besiktas, while Leipzig are at Monaco.