The Hammers announced the news via Twitter:
The Daily Mail (h/t TalkSport's Billy Hawkins) previously reported on the interest from Chelsea and Spurs.
While the transfer speculation has been ongoing for some time, most assumed Rice was eager to stay with West Ham, per Sam Inkersole of Football.london. The rumours were a result of a lengthy contract saga that has finally been resolved.
Rice took to social media after the news became official:
The 19-year-old was a member of Chelsea's academy until 2014, when he was released and joined West Ham. He made his senior debut in 2017 and has quickly emerged as one of the top young talents in the Premier League.
A defensive midfielder who can also play at centre-back, the new deal was wanted by the fans, who made their feelings known during the Hammers' 2-1 over Southampton on Thursday, per The Independent's Jack Pitt-Brooke:
"Most significant was the West Ham away end singing that the club should sign Rice to a new contract as soon as they can. He has become the most popular, important young British player at West Ham since the 1990s generation, all of whom went on to great things at other clubs. So the question now for West Ham is whether Rice will go the same way."
Rice has played for the Republic of Ireland's youth teams but has yet to officially commit his senior future to the nation.
He's eligible to play for England, but according to the Irish Times, he made his decision shortly before Christmas:
The new deal all but rules out an exit at some point in 2019. West Ham have been in fine form of late, winning five of their last six matches, and their positive momentum may have played a part in his decision to stay.
He'll continue his development under the watch of Manuel Pellegrini and will be one to keep an eye on. Rice has world-class potential, and if his growth continues at the same rate, the giants of English football may try their luck at some point in the future.