The Hammers had always intended to sign the Algerian on a permanent deal from Brentford before late medical complications during the summer window meant the move had to be quickly changed to a loan with an agreement to buy at the end of this season.
Brentford are owed a £20million fee, paid in instalments, as well as £5million in add-ons on top of the £5million loan fee paid last year. Benrahma has signed a five-and-a-half year deal in east London, keeping him at the club until the end of the 2025-26 season.
Manager David Moyes has been critical of Benrahma's early performances, with the 25-year-old yet to score, but the Algeria international has stepped up in recent weeks and the Scot was full of praise following his performance at Crystal Palace on Tuesday.
Speaking after the game, Moyes said: "I thought he played really well tonight and he played really well for the team tonight and it wasn't all his tricks with the football but it was his pressing and commitment to the team which we want everybody to buy into.
"If we have Said doing it then we are doing the right thing. Yes, he made a couple of wrong decisions with the final pass or decision but that is the thing we have been talking about that we have been a bit disappointed that we have not got from him but he is new to the Premier League and we can't be expecting too much too soon. I am sure once he settles down and gets used to it a little bit we will get much much more from him."
West Ham have brought the deal forward from the summer in order to free up a domestic loan spot for Jesse Lingard, who was finalising his move from Manchester United on Friday morning.