West Ham United will sign goalkeeper Jussi Jaaskelainen at the end of his Bolton Wanderers contract on 1 July.
The former Finland international, 37, played 529 games for Wanderers after arriving in 1997.
He will link up with former Bolton boss Sam Allardyce on a one-year deal, with the option for a further 12 months.
"After spending 15 years in Bolton, it's a great new challenge and I'm looking forward to it," Jaaskelainen told West Ham's official website.
"Everything has happened really quickly. When the opportunity was offered to come to West Ham, I didn't think twice and I just told my agent to sort it out as quickly as possible."
Jaaskelainen was brought to Bolton by then-manager Colin Todd from Finnish club Vassan Palloseura for £100,000.
He was a key figure at the Reebok Stadium as Allardyce guided Bolton to the Premier League via the play-offs in 2001, and was first choice for more than a decade.
However, he lost his place to Adam Bogdan last season as Owen Coyle's side were relegated to the Championship.
Jaaskelainen added: "I appreciate Bolton giving me permission to speak to West Ham before my contract was up and for the efforts the chairman made in trying to get me to stay.
"I would like to thank the fans for all their support over the years and I wish the players and, in particular, Owen Coyle all the best in gaining promotion at the first attempt."