After struggling for regular game time under David Moyes last season, the 29-year-old left-back decided to join Besiktas on a season-long loan deal last summer.
Masuaku has since established himself as a first-team regular with the Super Lig outfit, contributing with two goals and four assists in 27 appearances across all competitions.
It has now been confirmed by the Hammers that Masuaku's temporary spell in Turkey has been made permanent, ending his near six-year association with the Premier League club.
Besiktas are understood to have activated the option to buy the DR Congo international for a fee in the region of £2m.
Masuaku joined West Ham from Olympiacos in the summer of 2016 and made a total of 128 appearances for the Hammers in all tournaments, including 105 Premier League outings.
The left-back scored just two goals during his time with the East Londoners, scoring his first for the club in a 3-0 EFL Cup victory over Bolton Wanderers in September 2017 before finding the net in a 3-2 Premier League win over Chelsea in December 2021.
Masuaku played the full 90 minutes for Besiktas in a goalless draw away against Trabzonspor on Sunday and the Turkish giants currently sit third in the Super Lig table, occupying the final Europa Conference League qualification position.
Meanwhile, West Ham - who have used Aaron Creswell and Emerson Palmieri at left-back in Masuaku's absence this season - currently sit 15th in the Premier League table, four points above the relegation zone with a game in hand.