The 33-year-old was treated on the pitch after he was seen holding his chest just moments before half-time and was subsequently replaced during the break.
Medics tended to Aguero as he lay on his back but the player was able to walk off the pitch himself.
“I was told he was feeling a bit dizzy. I have just learned that he was taken to hospital and I can’t say much more until I know,” Barcelona’s caretaker coach Sergi Barjuan said after the match.
Aguero’s former club, Manchester City, posted a message on Twitter wishing the striker well.
“Everyone at Manchester City wishes you a speedy recovery,” it read. “We’re with you.”
Aguero was making his first start at the Camp Nou since his summer move from the Premier League club.
The forward has been recovering from injury while Barcelona has made a poor start to the season.
Ronald Koeman was sacked as manager last week as a result of the team’s poor form, with the club currently languishing ninth in La Liga.