The 24-year-old has been sidelined with a serious knee injury for the last 11 months, but the Romanian is now stepping up his recover under new head coach Michael Beale.
Beale revealed on Wednesday that a "senior" player was close to penning fresh contract terms with the club along with academy graduate Leon King.
The Gers confirmed on Thursday afternoon that King has signed a new long-term deal to remain at Ibrox, and Hagi has since followed suit, although the length of their new deals have not been specified.
Speaking to the club's official website about his new contract, Hagi said: "The history that this club has pushes you every single day on the pitch and off the pitch to be a better player and a better person.
"I like to think I have left something behind me and I have given really good memories to the fans but I still feel like I haven't done everything that I want.
"I still have a lot of things to show and give to this amazing group of people in Rangers as well as the fans, I just can't wait until I'm back."
Beale added: "I'm delighted for both Ianis and the club that he has agreed this new contract with us.
"He is someone who made a massive impact both on and off the pitch when I was here previously, and he will be a big asset for us when he makes his return from injury.
"His personality and outstanding professionalism too add so much to our group, and I really look forward to working with him even closer once he is back."
Sporting director Ross Wilson continued: "Ianis is a fantastic character and someone who has loved his Rangers journey so far. We are all delighted to see him back with a ball at his feet again, doing what he loves.
"He has wonderful support around him both internally at the club and externally to Rangers and we are delighted to have found agreement to extend his contract."
Hagi, the son of legendary Romanian footballer Gheorghe Hagi, joined Rangers from Genk in January 2020 on an initial loan deal before making his move permanent the following summer.
The midfielder has since made a total of 86 appearances for the Gers across all competitions, scoring 15 goals and registering 21 assists, and he has also won both the Scottish Premiership title and the Scottish Cup during his time in Glasgow.
Hagi has gone through a "rigorous and highly-detailed recovery programme" with the club's medical department and he is hoping to return to first-team action in the near future.
However, the 23-cap Romania international is unavailable for Thursday night's Scottish Premiership clash against Hibernian at Ibrox.