He had started to break through into the first team when he was signed by Real Madrid in 2019. After three successful seasons on loan at AC Milan, where he was a key part of their Serie A winning team of 2021–22, Brahim returned to Real Madrid in 2023 and became a consistent first team regular, winning La Liga and the Champions League in his first full season back in Spain.
Brahim initially represented Spain at youth level, before making his senior debut as well as scoring against Lithuania in 2021. However, Brahim would then decide to change his representative nationality to Morocco, the country of his father's heritage. After earning his first Morocco call-up in 2024, he featured in the squad that went on to win the 2025 Africa Cup of Nations on home soil, where he earned the Golden Boot and became the first player in the tournament's history to score in five consecutive matches. At the 2026 FIFA World Cup, Brahim recorded four assists to help Morocco reach the quarter-finals, becoming Africa's all-time World Cup assist leader in the process.