The Bulgarian poked home from close range with just five minutes of extra-time remaining as the 10-man hosts' resistance was finally brokenDimitar Berbatov's first goal for Monaco was enough to send them into the quater-finals of the Coupe de France with a 1-0 win over Nice.
The Bulgarian slid in to turn home Lucas Ocampos' cross deep into extra-time to seal a scrappy win for the visitors, who had struggled to break down the hosts' resistance despite having a man advantage for much of the game.
Neither side managed to exert any real dominance in a tame first half, with Ocampos spurning the best opportunity for the home side while Thimothee Kolodzieczak failed to beat Sergio Romero.
Anthony Martial came close with a lively run and shot from an angle but the match petered out to leave the sides deadlocked at half-time.
Kolodzieczak then handed Monaco the advantage shortly after the break, slapping out at Ricardo Carvalho to earn himself a straight red card and leave Nice with an uphill battle.
But Monaco failed to take advantage. Ocampos came close as he fired just wide from distance, and Dimitar Berbatov was set up by James Rodrigues but failed to control his effort from inside the area as the match laboured on into extra-time.
James must have thought he had snatched a winner as he rasped a low shot at goal from the edge of the area, only for Hassen to spring down to his left to parry the ball away.
But with just five minutes remaining, Monaco's pressure finally paid off. Ocampos' cross caused a mix-up in the Nice defence and Berbatov slid in to turn the ball home for his first goal for Claudio Ranieri's side.