Appearing on 98.5 The Sports Hub's Toucher & Rich (h/t Calli Remillard of Boston.com), Ainge said: "Kyrie just wanted to make that announcement then. I didn't know he was going to make it then and there. I think it's kind of neat that he did it where he did it, with all of the fans there on that night."
Last week, Irving addressed fans at an event for season ticket holders, saying, "If you guys will have me back, I plan on re-signing here next year."
While the timing surprised Ainge, he noted that he already knew Irving wanted to remain with the organization.
Ainge added: "The fact that he wanted to announce that and just get it out there was not surprising to us. We felt like we were going to move forward with Kyrie for years to come. We had talked about it a little bit, but I guess that was just when he was ready to tell everybody he wanted to stay."
Irving has a player option in his contract that would allow him to test free agency after the 2018-19 season.
The Celtics acquired Irving in a blockbuster deal with the Cleveland Cavaliers last offseason, sending Isaiah Thomas, Jae Crowder, Ante Zizic, the Brooklyn Nets' 2018 first-round pick and the Miami Heat's 2020 second-round pick to Cleveland.
Irving was highly productive in his first campaign with the Celtics, averaging 24.4 points, 5.1 assists and 3.8 rebounds per game en route to his fifth All-Star nod.
The 26-year-old was limited to just 60 regular-season games, though, and he missed Boston's entire playoff run to the Eastern Conference Finals with a knee injury.
Irving is now healthy, as is small forward Gordon Hayward, who missed all but one game in 2017-18. Adding them to a talented group that includes Jayson Tatum, Jaylen Brown, Al Horford, Terry Rozier and Marcus Smart makes Boston the team to beat in the Eastern Conference.
The Celtics will open their regular-season schedule Tuesday when they host the Philadelphia 76ers.