Ten-time champion Real Madrid trailed early against Bulgarian newcomer Ludogorets Razgrad, which was only formed as a club 13 years ago - in the same season the Spanish giant won its ninth title.
After Ludogorets' stunning sixth-minute opener, Cristiano Ronaldo had a penalty saved and then scored with a second spot-kick in the 24th, before Madrid got substitute Karim Benzema's 77th-minute goal to force a 2-1 win.
"We played as equal to Real and I am delighted with our performance," Ludogorets coach Georgi Dermendzhiev said.
"I thought we were too soft all over the pitch," Liverpool captain Steven Gerrard said, adding his team "didn't deserve anything" against Switzerland's champion.
More From This Section
Borussia Dortmund won 3-0 at Anderlecht, and leads Group D by three points from Arsenal, which beat Galatasaray 4-1 despite goalkeeper Wojciech Szczesny being sent off with 30 minutes left.
Atletico Madrid, runner-up last season, beat Juventus 1-0 through Arda Turan's 75th-minute goal, and Malmo's 2-0 victory against Olympiakos left Group A with all four teams on three points.
Ludogorets' fans have to travel 335 kilometers (210 miles) to watch their team play at the national stadium in Sofia because the club's 6,000-seat arena does not meet Champions League standards.
But the supporters soon had reason to celebrate after Brazilian midfielder Marcelinho headed in a cross flicked on to the far post.
Ronaldo had a 10th-minute penalty saved by goalkeeper Vladislav Stoyanov, but soon got a second chance to convert and close on Raul Gonzalez's record of 71 Champions League goals in the group stage and knockout rounds. Ronaldo has scored 69 goals - not including one in a qualifying-round match - and leads Lionel Messi by one in what promises to be a season-long duel.