Barcelona announced the Argentine forward would join them on July 1 when his current deal with Manchester City expires.
Aguero officially signed his contract with the Catalan club at 5pm BST time, and was presented to the media an hour later in the club’s maroon and blue strip.
"Barcelona are the best team in the world," Aguero, who celebrates his 33rd birthday on Wednesday, told a news conference. "And we all know it.
"It was a good decision to join and help the team achieve things. It's another step and I'm very happy. I hope I can contribute a lot to the club.
"The first thing is to try and play and help the team as much as I can. We are a team, and I will try my best.
“Hopefully we can get to the end of the season and be in contention for the important trophies."
Barca said Aguero's buy-out clause had been set at 100million euros (just over £86million).
City announced on March 29 that Aguero's contract would not be renewed and that his 10-year stint at the club would end this summer.
Aguero joined City from Atletico Madrid in 2011 and went on to score 260 goals for the club, none more important than the stoppage-time strike which sealed the 2011-12 Premier League title.
His final appearance for City came in Saturday's disappointing defeat to Chelsea in the Champions League final in Porto.
In all, he won five Premier League titles, one FA Cup and six League Cups with City.
Aguero began his professional career with Argentinian club Independiente before joining Atletico in 2006, where he won the Europa League in 2010.
Man City posted a tweet in recognition of the news which read: "Sergio Aguero will join Barcelona at the end of June. Thanks for everything aguerosergiokun"
On Sunday, a tweet on Aguero's own official Twitter account read: "Proud of this team and to have worn its colours for so many years. Manchester City, forever in my heart."
Additional reporting by PA.