Guinea captain Pascal Feindouno scored twice in 3-2 Group A win over Morocco but could miss the rest of the African Nations Cup after being sent off.
Guinea, who lost their opening game against hosts Ghana, are back in contention for a quarter-final place but Feindouno's dismissal for stamping on 67 minutes could cost him at least a two-match suspension.
Feindouno could also be further sanctioned by the Confederation of African Football, effectively ending his interest in the tournament.
He gave Guinea an 11th-minute lead with a crafty free kick, catching out Morocco keeper Khalid Founami from a tight angle and it was the midfielder's pass that set up Ismael Bangoura for a 2-0 lead on the hour.
Substitute Hicham Aboucherouane pulled one back almost immediately for Morocco, hitting an extraordinary effort from outside the penalty area.
But it was Feindouno who restored the two-goal lead when he converted a 63rd-minute penalty, awarded after Souleymane Youla had been brought down by Morocco defender Michael Chretien.
Within minutes the Guinea captain had been sent off for lashing out at El Armine Erbate.
"Pascal is a key player and we will have to find a solution," said Guinea coach Robert Nouzaret.
Morocco got a late consolation from defender Abdelsam Ouaddou who netted with a close-ranger header in stoppage time.
"We lost the game at the crucial moments. Now we have to battle to beat Ghana to go through," said Morocco coach Henri Michel, whose side share three points with Guinea in Group A after two matches each.