The midfielder had been considering his future, but after speaking with new coach Xabi Alonso, he has decided to stay with the team.
Xabi Alonso had one-on-one talks with Brahim to help convince him to sign a new deal.
Earlier this summer, there were reports of interest from PSG, but Brahim has chosen to remain with Real Madrid.