Hanni played his first official game with his new club in the preliminary round of the UEFA Champions League against the Russian club Rostov scored his first goal with the team and after that missing a significant opportunity by not fit, delivers an assist to Tielemans which doubles the score in the first Continental participation in its history. However in the second leg on 3 August 2016, the club lost 2–0, therefore being eliminated in the UEFA Champions League. Hanni made his Anderlecht debut in the opening game of the season against Royal Excel Mouscron, where he started the whole game and set up a goal for Idrissa Sylla, who scored a winning goal, in a 2–1 win. In a follow up match against K.V. Kortrijk, Hanni scored his first league goal for the club, as well as, setting up the club’s second goal of the game, in a 5–1 win. Five days later on 12 August 2016, he captained the side for the first time in absent of Steven Defour, where he started the match before being substituted in the 81st minutes, in a 0–0 draw against Sint-Truidense. Hanni played and captained in both legs of the UEFA Europa League Qualifying against Slavia Prague, scoring in the first leg, as Anderlecht won 6–0 on aggregate. He scored again on 11 September 2016, in a 3–2 win against Charleroi, and scored two weeks later on 25 September 2016, in a 2–1 loss against Westerlo. Having quickly became a first team regular since joining Anderlecht, Hanni spent the next four months as the club’s captain, helping the side reach the top of the table. He spoke about his development as the club’s captain in Defour’s absent. During a 1–1 draw against Saint-Étienne on 29 September, he suffered a pain in the adductor muscles in the last fifteen minutes and had to be substituted. But he recovered quickly and started in a match against rivals, Standard Liège, on 2 October 2016 before being substituted in the 75th minutes, as Anderlecht won 1–0, earning their first win against their rival since 2012. Following a 3–2 loss against Zulte Waregem on 27 November 2016, Hanni made a comment about Manager René Weiler, leading to the Belgium media claims that the pair had fell out and igniting transfer report claims. But Hanni responded that denied claims from the Belgian media that the pair fell out. He then played an important role as captain when he provided three assists in the UEFA Europa League Group Stage that saw them qualified for the knockout stage. Hanni ended his two months goal drought when he scored the club’s second goal of the game, in a 7–0 win against Royal Excel Mouscron on 27 November 2016. This was followed up by setting up the club’s last two goals, in a 3–1 win against K.V. Kortrijk. Two weeks later on 18 December 2016, Hanni scored twice, scoring the club’s first and fourth goal of the game, in a 4–0 win against Eupen. He missed two matches at the beginning of January, due to his international commitment with Algeria at the African Cup of Nations campaign. It wasn’t until on 29 January 2017 when Hanni made his first team return from his international commitment, coming on as a 75th minutes substitute, in a 0–0 draw against rivals, Standard Liège. He then scored two goals in two matches between 12 February 2017 and 19 February 2017 against Zulte Waregem and Oostende. Two months later on 16 April 2017, Hanni scored against Oostende once again, scoring the only goal of the game, in a 1–0 win. Four days later on 20 April 2017 in the second leg of the quarter–finals of the UEFA Europa League against Manchester United, he scored an equaliser, as they lost 2–1 and the club was eliminated from the tournament. Hanni then scored his thirteenth goal of the season, in a 1–1 draw against Club Brugge, as the club becomes closer to win the title. In a follow up match against Charleroi, he set up the club’s last two goals of the game, in a 3–1 win, a result that saw Anderlecht becomes the Jupiler League’s champion. Despite missing one match due to a groin injury during the 2016–17 season, Hanni finished his first season at Anderlecht, making fifty–five appearances and scoring thirteen times in all competitions. He also ended the season with thirteen assists. Hanni was nominated for Belgian Lion Award and Belgian Professional Footballer of the Year but lost out to Ishak Belfodil and Youri Tielemans respectively. But his goal against Oostende, nevertheless, earned him the Goal of the Year award.