The Czech Republic international joins the Hammers on a four-year deal for £15m (€16.5m).
— West Ham United (@WestHam) July 24, 2020
Soucek, 25, has impressed since joining West Ham on a £4m (€4.4m) loan deal in January, scoring three goals in 12 league appearances.
The purchase clause only applied if West Ham avoided relegation, which David Moyes has ensured they will.
Speaking to the official West Ham site, Moyes expressed his delight at the signing.
“I’m delighted that Tomas has signed his permanent contract to secure his long-term future at the Club,” said Moyes.
“When I came in, we talked about needing another midfield player, to help Declan Rice and Mark Noble, and I think he’s been a really good fit for us.
“He’s a terrific lad with very good physical capabilities. He has scored some really important goals for us, against Chelsea, Newcastle and Watford.
“We’re glad he’s going to be a West Ham player for a good period to come.”
A two-time Czech league winner with Slavia Prague, Soucek has made 25 appearances for his country.