The Argentine, 32, leaves City after 10 years at the club, during which he became their all-time leading goalscorer with 260 goals in 390 games.
His last appearance came off the bench in Saturday’s Champions League final defeat by Chelsea.
“We all know that Barcelona is the best club in the world,” said Aguero.
“I think I made a great decision to be here and of course it is a step forward in my career.
“I am really happy and hopefully I can help the team to win things.”