Cannot play media. Sorry, this media is not available in your territory.
Highlights: Ivory Coast 1-2 Argentina
Striker Lionel Messi starred for Argentina in their opening Olympic victory after his club Barcelona cleared him to play.
The 21-year-old put the champions ahead and created another goal in the 2-1 win over the Ivory Coast on Thursday.
A day earlier, the Court of Arbitration for Sport (Cas) ruled that Barcelona, Schalke and Werder Bremen could recall their players from the Games.
But as the tournament began, all three were included in their national sides.
Barcelona had not officially announced any decision on Messi's participation before Argentina's match kicked off.
Officials later confirmed they would not be recalling the player after he expressed his desire to remain at the Games during talks with the club late on Wednesday.
"He can stay at the Olympics through to the final," said Barcelona spokesman Jose Miguel Teres.
Barcelona coach Pep Guardiola added: "The best thing is for him is to enjoy (the Olympics), that he should play there. It's our obligation and it is what we are going to do so that he can enjoy the games and come back happy."
The Argentina Football Association will fund an expensive insurance policy which would see Barcelona receive a large pay-out should Messi be injured at any point during the Games.
He will also be exempt from certain future friendly matches involving Argentina, allowing him to remain in Spain with the Barcelona squad.
Ahead of his appearance in the Group A game at the Olympics, a huge roar from the Shanghai crowd greeted the announcement of his name as the teams were read out.
And Messi did not disappoint, bagging a goal with two minutes of the first half left, neatly sidefooting home to put his side a goal ahead.
The Ivory Coast equalised through a powerful Sekou Cisse header seven minutes after the break, but Messi set up an 85th-minute winner for Lautaro Acosta after his shot was saved.
Schalke and Werder Bremen allowed Brazilians Rafinha and Diego to stay with their squad and both featured in an earlier 1-0 defeat of Belgium.
Cas made its decision on Wednesday, which had initially appeared to end the trio's hopes of appearing in the tournament.
World football's governing body Fifa, which had earlier ruled that clubs must release players aged 23 or under if a nation requests them, said it was "surprised and disappointed" by the decision and appealed to the clubs to let the players take part.
Cas found that Fifa's position was based on custom rather than law, meaning clubs could not be forced to release their players.
The court ruled there was "no specific decision of the Fifa executive committee establishing the obligation for the clubs to release players under 23 for this tournament".
Fifa president Sepp Blatter has already said a review of Olympic football regulations would be conducted to ensure the London Games in 2012 are not hit by more club-versus-country rows.