Substitute Hameur Bouazza scored in extra time to give Algeria a 3-2 win over fellow World Cup qualifier Ivory Coast and a spot in the semifinals of the African Cup of Nations Sunday. Algeria, which is playing in the biennial tournament for the first time since 2004, will next face either defending champion Egypt or Cameroon. Ghana earlier beat host Angola 1-0 to clinch a place in the semifinals. Bouazza took advantage of poor marking by Ivory Coast defenders to score the winner in the second minute of extra time, heading home from Karim Ziani's cross from the left just a minute after coming on. Ivory Coast midfielder Salomon Kalou had opened the scoring in the fourth minute from close range before Karim Matmour's equalizer five minutes before the break. Ivory Coast thought it had won the game after substitute Kader Keita scored in the 88th minute with a superb 30-meter strike into the top left corner. But Madjid Bougherra leveled for Algeria in injury time with a header after being left unmarked on the edge of the six-yard box. Asamoah Gyan gave Ghana a 1-0 win over host Angola in the other quarterfinal Sunday. Gyan received a pass from Kojo Asamoah before firing a diagonal shot into the bottom corner. Ghana, a four-time African Cup champion who has also qualified for the World Cup, will either play Zambia or Nigeria. The two teams meet Monday. Luanda's 50,000 seater stadium was full to capacity as the boisterous home support urged Angola on, and the home side started well, pressing forward and winning an early corner after Flavio's long range shot took a deflection off a Ghana defender. Missing the midfield leadership of Chelsea's Michael Essien and Bologna's Stephen Appiah, Ghana looked shaky, with Andre Ayew getting a yellow card in the opening minute for a late challenge on Mabina. And Ghana's left back Addy Lee twice almost beat his own goalkeeper Richard Kingson in the opening quarter of an hour. That gave the home crowd encouragement, but Gyan's 16th minute goal quietened the home support. Asamoah, who plays for Udinese in Italy's Serie A, pumped a long ball forward to Gyan, who outpaced Angola captain Kali to score from 15 yards. Exploiting poor marking from the Ghana defense, Flavio presented Manucho with an easy tap-in just before the break, but the Real Valladolid forward blasted his shot over. Angola pushed for an equalizer in the second half, and went close in the 70th when Gilberto's free kick from 20 yards was deflected just wide. Manucho missed another good chance two minutes later when he headed wide after substitute Job had sent in an enticing cross from the right. In the final minute, defensive midfielder Isaac Vorsah denied Angola a last gasp equalizer when he cleared captain Kali's well placed shot off the line.