Bebe scored a 40-yard free-kick as Cape Verde beat Mozambique to become the first team to book their last-16 place at the 2023 Africa Cup of Nations.
The Rayo Vallecano forward, once of Manchester United, smashed in a strike which keeper Ernan Siluane should have done better with.
Captain Ryan Mendes took advantage of a defensive mistake to double their lead.
Kevin Pina then hammered a brilliant strike into the top corner from outside the box to seal the win in Abidjan.
Mozambique’s best moments came through Geny Catamo. He won a penalty in the first half, which was overturned by the video assistant referee (VAR), hit the crossbar with a free-kick and had one of their two shots on target.
Victory means Cape Verde have guaranteed top spot in Group B, ahead of former champions Egypt and Ghana, with a game to spare.
The Blue Sharks face the North Africans in their final group match on Monday (20:00 GMT) knowing that they will meet a third-placed finisher from Group A, C or D in the last 16 seven days later.
Cape Verde surprise winners of tough group
Nobody would have expected the Blue Sharks to have won a group containing Egypt and Ghana with a game to go but that is precisely what happened.
Bubista’s side, ranked 73rd in the world, are in their fourth Africa Cup of Nations – and have progressed from the group stages in three of them.
Cape Verde, who beat Ghana, and Mozambique, who drew with Egypt, both came into this game high on confidence after good opening results.
But the Mambas, who sit 111th in the Fifa rankings, were well beaten this time out.
Bebe, who made his Cape Verde debut in 2022 after switching international allegiance from Portugal, hit the woodwork with a free-kick before scoring from way out thanks to some shoddy goalkeeping.
The islanders rarely looked back after that, and Witi had Mozambique’s only shot on target until Geny forced a save in injury time.
Egypt and Ghana, who sit on two and one point respectively, could both go through yet with the four best third-placed teams reaching the last 16.
Mozambique, who have never won an Africa Cup of Nations game, could also reach the knockout stages if they beat Ghana.