He is City's first signing since Patrick Kisnorbo took over from Erick Mombaerts as coach last week.
"We have been following Aiden's career path closely and believe he is one of Australia's best young midfield prospects and we're very happy he has chosen to sign for our club on a three-year deal," City director of football Michael Petrillo said.
"Aiden's quality in the midfield as a player who is able to play as a defensive midfielder or in a more attacking role makes him an ideal, versatile player who will be able to fit straight into our City style of attacking football."
O'Neill made his Premier League debut in 2016 against Liverpool and had three total appearances before being sent out on loan.
He made 23 A-League appearances at the Mariners, then 17 at the Roar, while also helping the Olyroos qualify for the Tokyo Olympics.
O'Neill said he was looking forward to pushing himself at City, who will commence preseason training on Oct. 5.
"Signing for the next three seasons shows my commitment to the club and I'm ready to establish myself in one of the strongest midfields in the league," he said.
City also confirmed winger Lachlan Wales' departure after 53 appearances and three goals in two seasons.