Perez, 29, joined Arsenal from Deportivo La Coruna in August 2016 and spent last season on loan back at the Spanish club.
“I’m very excited, as West Ham are giving me the chance to stay in the Premier League and I’m very happy to be part of this new project,” Perez said on West Ham’s official website.
“West Ham have great fans and play in an amazing stadium, so to sign here brings me great joy. I’m very motivated.”
Perez scored seven times in 21 appearances for Arsenal, including a hat-trick in the Champions League away to Basel.
However, the striker then opted to return to Deportivo on loan last season in search of more regular first-team football.
In a message on his personal Twitter account, Perez said: “I would like to thank Arsenal fans for their support, they always showed me great affection and love from the first time I arrived in London.
“I also want to give my thanks to my team-mates and to the staff of this club for giving me the opportunity to make my debut in one of the best leagues in the world and win the FA Cup.
“I wish you all the best for the future and I hope you can go on and achieve great things.”
The fee for the transfer is believed to be worth around £4million, plus add-ons.
Perez’s switch to the London Stadium sees him reunited with former Gunners midfielder Jack Wilshere, who joined West Ham following the end of his contract.
New Irons boss Manuel Pellegrini has now brought in nine players during the summer window, spending more than £100million, as he looks to reshape a squad which battled for survival during most of the previous campaign under David Moyes.
West Ham director of football Mario Husillos is confident Perez will prove another valuable addition.
“Lucas is a very experienced player that Manuel and I both know well from Spain,” Husillos said on the club website.
“He has great technical quality, and can play as both the main striker or the second striker in a deeper role. He scores goals, but can also create them and link well with the midfielders.
“His style is different from the other strikers we have available to us, and that gives the manager more options for our attacking play.
“Lucas also has experience of the Premier League with Arsenal, and is familiar with life here in London, which of course means that he will take less time to adapt and be ready.”
Know more about Sport360 Application