In Group H, Greece moved into second place with a come-from-behind 2-1 victory in Cyprus after Bosnia and Herzegovina had suffered a stunning 4-3 home defeat by already-qualified Belgium.
Les Bleus were a long way from their fluent best in Sofia, but a third-minute goal from Blaise Matuidi propelled them back to the summit of Group A in Russian Federation 2018 qualifying. The game was however turned on its head for a second time after the break, with goals from Michy Batshuayi and Jan Vertonghen putting Belgium 3-2 up.
France, who are a point ahead of Sweden at the summit, face a potentially tricky trip to Bulgaria on Saturday, before hosting Belarus on Tuesday. It was a nervy performance from the French, who endured long spells of pressure from the Bulgarians and saw N'Golo Kante pick up a hamstring injury after just half an hour, although victory at home to Belarus on Monday will secure their place in Russian Federation.More news: Canada police probe car and knife attack as terrorism
However, with Portugal's only loss having been away to the Swiss, Ronaldo and co have an opportunity to top the group if they can win the crunch clash between the pair in Lisbon on Tuesday.
The French are assured of at least a playoff place, with the best eight second-placed teams going through to the two-legged playoffs.
Portugal go into that game with Switzerland three points behind their rivals but with a much better goal difference meaning the victor will be guaranteed a place in Russian Federation nest summer.
"Thank God that he scored", said Portugal coach Fernando Santos.
Cristiano Ronaldo finally opened the scoring in the 63rd minute before André Silva secured the win in the 86th.