Aguerd is a defender for Rennes in France.
The Hammers have confirmed that the player has signed a five year contract.
The left-sided player made 66 league appearances for Rennes.
He said he was excited when he heard about the club's interest. It's a dream for every player to play in the premier league.
The transfer fee for Aguerd, who has 25 caps for Morocco, is the fourth-highest paid by West Ham.
It was a difficult decision for Aguerd to leave Rennes as he had enjoyed exceptional times at the club.
The Hammers qualified for Europe for the second year in a row after finishing seventh in the league.
The club is a historic one. The fans and atmosphere at the games were great, and I saw a few of them.
The manager wanted Aguerd to help the Hammers get back into the top six next season.
He will add to our defensive options.
I am confident that he will fit in well at Rush Green because of his desire to improve and be successful.
In last year's Africa Cup of Nations quarter-finals, Aguerd was present, as well as in the two World Cup play-off matches against DR Congo.
On our dedicated page, you can find all the latest football transfers.