Belgium, seen by many as genuine contenders in Brazil, was losing to Sofiane Feghouli’s first-half penalty until Coach Marc Wilmots made all three substitutions by the 65th minute.
First Fellaini leveled with a towering header 20 minutes from time then Mertens, sent on at the interval, rifled home Eden Hazard’s 80th-minute pass.
Kevin De Bruyne played a key role in both goals having struggled as much as anyone in the first period. Belgium was ponderous throughout the first half, despite enjoying the lion’s share of possession.
Hazard and De Bruyne saw plenty of the ball, but struggled to break down an organised Algeria leaving Romelum Lukaku isolated and out of the game.
With Rafik Halliche and Madjid Bougherra confidently marshalling the penalty area, Belgium began to rely on longer-range attempts – Daniel van Buyten’s easily charged down before Axel Witsel finally worked RaisM’Bolhi with a drive from 25 yards.
Algeria needed to make the most of their own breaks and duly won a penalty with their first serious foray. Nabil Bentaleb started things by releasing Faouzi Ghoulam on the left and his whipped cross from the left was heading for Feghouli.
The striker might not have reached it but Jan Vertonghen rendered that academic when he made a mess of his tracking run and felled his man. Feghouli eyed Thibault Courtois all the way as he rolled his shot home. Belgium attempted to respond but was drawing blanks.
De Bruyne and Vertonghen wasted a pair of promising free-kicks and Witsel saw a second decent strike saved after taking the ball down on his chest. Hazard’s break gave NacerChadli sight of goal before the interval but he shot tamely at M’Bolhi and was replaced by Mertens at half-time.
The sides exchanged half-chances from corners, Witsel heading over and Carl Medjani flicking past the far post. By 65 minutes Wilmots had made two more substitutions, DivockOrigi and Fellaini on for Lukaku and MousaDembele.
Origi had a great early chance, going one-on-one with M’Bolhi only to see his low effort well stopped by the advancing keeper. But it was Fellaini who made the difference, rising to head De Bruyne’s curling cross in off the underside of the bar.
Wilmots’ changes continued to reap benefits when Mertens put his side ahead 10 minutes later. De Bruyne was involved again, this time winning back possession by tackling Feghouli.
That set in motion a swift counter and Hazard read the situation perfectly, drawing the defence before finding Mertens who rifled home.