Paris Saint-Germain missed out on the chance to top Champions League Group A as they were held to a 2-2 draw by Ludogorets.
A win would have seen PSG through as group winners, but they twice fell behind to their Bulgarian opponents and, with Arsenal beating Basle 4-1, had to settle for second place.
Virgil Misidjan gave Ludogorets a surprise early lead but the hosts' superiority looked to be telling when Edinson Cavani levelled with his 20th goal of the season.
However, Wanderson restored the visitors' advantage on the break and it took until stoppage time for Angel Di Maria to find an equaliser.
PSG unsurprisingly started on the front foot, with Lucas Moura and Cavani both drawing saves from Vladislav Stoyanov.
However, Ludogorets, whose only previous Group A points had come in two drawn games against Basel, stunned the Parc des Princes crowd after 15 minutes when Misidjan headed in Pimienta Natanael's left-wing cross.
Thiago Motta headed a cross wide, but the Bulgarian side should have doubled their lead when Igor Plastun flicked on a corner only for Marcelinho to head wide from a yard out.
The French champions responded, Thiago Silva sending a header off target from one corner, then thumped an effort against the post moments later from another.
Di Maria tested Stoyanov from distance and Blaise Matuidi saw his effort blocked by Plastun.
Motta's 20-yard effort at the start of the second half was easily held by Stoyanov but Cavani equalised after an hour with an overhead-kick after the away side failed to clear their lines.
Hatem Ben Arfa's goal-bound shot appeared to be blocked by a Ludogorets arm moments later, but referee Tasos Sidiropoulos waved away the penalty appeal.
Ludogorets restored their lead in the 69th minute when Marquinhos hesitated and was dispossessed by Jonathan Cafu, who cut the ball back for Wanderson to fire in a low effort.
Thiago Silva hit the woodwork for a second time with a header against the bar from the resulting corner and, although Di Maria stabbed home an equaliser in stoppage time, Arsenal's win in Switzerland meant it made no difference to the final standings.