BBC Sport, Cairo
Drogba scored the Ivory Coast's opening goal
Didier Drogba and Yaya Toure scored as the Ivory Coast defeated Libya in their African Cup of Nations Group A match at the Cairo International Stadium on Tuesday.
The result leaves Ivory Coast with six points after two games and a place in the quarter-finals, after Egypt drew 0-0 with rivals Morocco in the other Group A game.
"I'm delighted that we've qualified for the quarter-final and all credit go the players," said Ivory Coast coach Henri Michel.
But the West Africans were given a genuine scare by the impressive Libya, who equalised through Abdelsalam Khamis.
Libya started poorly and it looked as though it would be the widely expected regulation victory for the Ivorians after they took the lead in the 10th minute.
Arouna Kone broke down the left wing and cut inside before shooting.
The Libyan keeper fumbled his save and Kone knocked the rebound into the path of the onrushing Drogba, who drove home from close range.
But far from building on their lead, the Elephants allowed an adventurous Libyan team to create a number of good chances.
Libya's free-flowing play seemingly discomforted the Ivorians, who had made plenty of changes from the starting line-up that claimed victory over Morocco in their first Group A game.
And Libya received their just rewards a minute before half-time when a header from Khamis 10 yards out from goal squeezed under the diving Jean-Jacques Tizie.
Parity at half-time was scarcely more than the Libyans deserved - but the Ivorians looked unsettled by their opponent's battling performance.
Libya's pace hardly let up in the second period - and as the Egyptian crowd grew steadily noisier in anticipation of their own match later in the day they noisily threw their support behind their North African counterparts.
And Libya were unlucky not to take the lead when a wonderful passing phase culminated in Nader Kara clipping the post.
But the natural order of things was restored by Tore on 74 minutes when he looped a header over the keeper and into the net despite the despairing efforts of two Libyan defenders stood on the line.
Ivory Coast will need a point against hosts Egypt in their final group game to emerge as group winners.