Elneny's previous contract would have expired at the end of this season.
The 30-year-old joined Arsenal from FC Basel in January 2016 and has made 155 appearances in total for the club, scoring six goals and providing 10 assists.
Elneny has not always been a regular starter in his time at Arsenal, spending time on loan at Besiktas in the 2019/2020 season.
He has made eight appearances in all competitions this season but is highly revered among the Arsenal squad.
“I’m so happy, I love this club and our supporters so much and I’ll give everything to help us be the best we can be, every day I’m here,” he said upon the announcement.
“It makes me so proud to have represented this amazing club since 2016. The spirit and togetherness we have in our squad right now is so positive and I’m so happy I have extended my contract.”
Elneny is expected to miss the rest of this season after picking up a serious knee injury last month.
Elneny has won one FA Cup and the Community Shield twice during his time at Arsenal.