Steve Bruce had revealed his keenness to secure Ritchie and Shelvey on longer deals after succeeding Rafa Benitez last summer.
“We’re delighted,” said United’s head coach. “They’ve been very good over the last few years for Newcastle. Thankfully, there’s been a really good conclusion.
“They’re a big make-up of the team, and we’re delighted they’ve committed their future.
“The nucleus of the team got out of the Championship – and it’s still here today. These two have been instrumental in the core group. Let’s hope now we can get two or three others done as well.”