West Ham have signed Roberto on a free transfer, with the Spanish goalkeeper penning a two-year deal at London Stadium.
The 33-year-old will join the Irons on 1 July, when his contract with La Liga club Espanyol expires.
Roberto, an Atletico Madrid youth graduate, has played for Benfica and Real Zaragoza, and won three Greek Superleague titles with Olympiakos.
“I think everyone who follows football knows the importance of this club, so I’m really excited,” Roberto said.
Roberto arrives as back-up to Lukasz Fabianski following the departure of Adrian.