Egypt captain Ahmed Hassan scored three times, including a first-half own goal, as the holders overcame Cameroon 3-1 after extra-time on Monday to advance to the African Nations Cup semi-finals.
The 34-year-old midfielder, celebrating an African record 170th international appearance, equalised at the right end and later grabbed a controversial third goal for Egypt as they kept up their bid for an unprecedented third successive title.
After the game ended 1-1 in 90 minutes, Mohamed Nagui and Hassan netted in extra-time to extend Egypt's record unbeaten run at the Nations Cup to 17 games.
The champions next meet arch-rivals Algeria in Thursday's semi-final in Benguela.
"It was my fault for the first goal but the team showed great character in fighting back," Hassan told reporters. "It is also what we did in our first game against Nigeria."
Hassan's 94th-minute free kick, which was partially blocked by Cameroon goalkeeper Idriss Carlos Kameni and bounced back off the woodwork, was adjudged to have crossed the line even though television replays indicated otherwise.
The goal came three minutes after substitute Nagui had put Egypt 2-1 up in an error-strewn match at the Ombaka Stadium.
Nagui pounced to score after a wayward back pass by experienced full back Geremi.
LANDMARK GAME
Hassan's landmark game started badly when he flicked an inswinging corner from Achille Emana into his own net after 25 minutes.
Hassan, though, redeemed himself with a 35-metre free kick that dipped in front of Kameni and bounced into the net 12 minutes later.
The teams battled through a niggly second half and were restricted to a series of unsuccessful long-range efforts.
Cameroon's hopes took a knock when defender Aurelien Chedjou was sent off for a professional foul with nine minutes left in extra-time.
Chedjou was preferred in the starting line-up to Rigobert Song, whose run of 36 successive Nations Cup finals matches stretching back to 1996 came to an end.
Cameroon captain Samuel Eto'o refused to blame defeat on Egypt's disputed third goal.
"We have to admit Egypt are a formidable team," he said.
NIGERIA IN LAST FOUR
Meanwhile, Nigeria goalkeeper Vincent Enyeama saved a spot-kick and scored the decisive penalty in a 5-4 shootout victory over Zambia that put the Super Eagles through to the semi-finals on Monday.
Enyeama saved Zambia defender Thomas Nyirenda's attempt, then kept his composure to slot past opposite number Kennedy Mweene. The quarter-final finished goalless after extra time.
Nigeria will take on Ghana in Luanda on Thursday in a clash between two World Cup-bound teams while holders Egypt play Algeria in Benguela.
Nigeria were reduced to 10 men in extra time after Onyekachi Apam was sent off in the 106th minute for a second booking, but held on against a dogged Zambian team who belied their lowly world ranking.
Egypt make winning start to title defence
African Nations Cup: Egypt in last eight
Eto'o helps pull Cameroon back from the brink
Nigeria advance, Egypt maintain perfect record
Communal clashes in Nigeria claim 192 lives