Morocco stunned Brazil 2-1 in a friendly international on the last 26 march as the north African side recorded a first win over the five-time world champions.
Midfielder Sofiane Boufal gave Morocco the lead in the 29th minute before Brazil skipper Casemiro levelled in the 67th minute in Tangiers.
But Abdelhamid Sabiri struck the winner in the 79th minute as Morocco showed that becoming the first Arab or African nation to reach the World Cup semi-finals last year was no fluke.
Only 10 of the 23-man squad that took Brazil to a disappointing quarter-final exit at the World Cup made the trip to Morocco.
The injured Neymar was again missing, with his number 10 shirt passing Real Madrid youngster Rodrygo.
Brazil also had a new manager in the dugout, with interim coach Ramon Menezes having replaced Tite, who stepped down after the World Cup quarter-final exit at the hands of Croatia.
The Brazilian Football Confederation (CBF) hopes to be able to announce the name of its new coach before the start of qualifying for the 2026 World Cup in September.
According to Brazilian media, the CBF’s first choice is Carlo Ancelotti, currently in charge of Real Madrid.
However, he is not expected to decide on his future before the end of the European season.
Before kick-off at the Ibn Batouta Stadium on Saturday, both teams paid tribute to Pele, who died last December at 82.
Prior to 26 March, Morocco had lost their only two previous matches against Brazil, 2-0 in a 1997 friendly and 3-0 in the group stage of the 1998 World Cup in France.