Juventus lost 2-1 at Young Boys in the Champions League, joining Real Madrid on Wednesday as a group winner which had already qualified before losing to a last-placed team.

Cristiano Ronaldo hit a post with an 87th-minute header for Juventus, and played the full game despite the plastic playing surface at Stade de Suisse and temperatures below freezing in Bern.

Ronaldo was also responsible for a stoppage-time equalizer being ruled out for offside when he leaped in front of goalkeeper Marco Woelfli to try to divert Paulo Dybala’s shot that rose into the top corner of the goal.

Dybala had cut the deficit for Juve, scoring from a powerful shot in the 80th only eight minutes after coming on as a substitute.

Veteran forward Guillaume Hoarau starred for Young Boys with goals in the 30th and 68th minutes.

The 34-year-old former France international scored first from the penalty spot, and then with a well-placed shot to give the Swiss champion a first win of the group stage.

Despite the defeat, Juventus still won Group H by two points — and will be seeded in Monday’s round of 16 draw — because runner-up Manchester United lost 2-1 at Valencia.

Three-time defending champion Madrid is also seeded in the draw despite a 3-0 home loss Wednesday against CSKA Moscow.

Juventus coach Massimiliano Allegri declined to rest Ronaldo though he did leave key defender Giorgio Chiellini and midfielder Blaise Matuidi on the bench.

The penalty for Young Boys was conceded by Alex Sandro minutes after replacing the injured Juan Cuadrado. The Brazilian left back was falling and off balance when he hooked a foot around the ankle of Nicolas Moumi Ngamaleu to pull down the Young Boys midfielder.

Hoarau’s spot-kick was read by goalkeeper Wojciech Szczesny, who dived to his left but could only push the ball onto the inside of the post and into the net.

It was a 100th goal for the club  for Hoarau who wears the No. 99 shirt. His 101st came midway through the second half, finishing a counterattack by cutting inside Leonardo Bonucci to slide a low left-footed shot past Szczesny.

Inbetween his goal, Hoarau also managed to strike the ball against his own bar, when Alex Sandro’s header glanced off his leg and rebounded to safety.