The 26-year old Spanish goalkeeper comes out of contract with Betis on July 1 and will then begin his career with the Hammers whom he has joined as a free agent.
"I am extremely happy and ecstatic to have joined such a legendary and historical club in both London and in England," he told the club's official website.
"I am really looking forward to being able to kick-off my career in the best league in the world with West Ham.
"I started off my career as a ten-year-old and have been there all of my life. I came through the ranks and I made my first-team debut in the sixth league game of last season against Malaga and was an ever-present since.
"For me, the icing on the cake was helping the team to qualify for the Europa League in, like West Ham, our first season back in the top flight after we had spent three years in the Second Division. Achieving this qualification was a massive farewell gift for the Betis fans."