SAN JOSE, Calif. -- Andre Silva scored with the last kick of the game as AC Milan punished Barcelona for failing to take their chances in the International Champions Cup on Saturday.
Riqui Puig had just missed a golden chance to win it for Barca when Milan countered, with Franck Kessie feeding substitute Silva to net the winning goal in a 1-0 victory at Levi's Stadium in stoppage time.
Barca had been the better side for large patches of the match before that but lacked a cutting edge in the final third.
Milan, meanwhile, were relative spectators at times but they did come into the match more after the break when Gennaro Gattuso introduced Silva, Giacomo Bonaventura and former Barca midfielder Alen Halilovic.
Gattuso's side return to Italy with their first win, following a penalty shootout defeat to Manchester United and a loss to Tottenham, while Barca head back to Spain having failed to win an ICC game in normal time.
They beat Tottenham on penalties but lost to Roma, although Ernesto Valverde will take plenty of positives from the tour of the United States --- such as the emergence of Puig and the performances of the new signings, Arthur, Malcom and Clement Lenglet.
Barca were well on top in the first half, ending the opening 45 minutes with nearly 70 percent of possession and seven shots.
It took Gianluigi Donnarumma's finger tips to prevent Munir El Haddadi opening the scoring inside 60 second as Barca, for their third consecutive ICC game, flew out of the traps.
Milan's best chance in the first period soon followed as they exploited the space left by Barca at the back. However, Fabio Borini's shot was blocked by Marlon Santos.
Donnarumma then made a smart save from a speculative Arthur curler before Malcom hit the post after good work from young left-back Miranda.
Munir then robbed the ball inside the final third and drove forward but his shot was drilled inches wide of the post.
Barca maintained control after the break but Milan began asking more questions. Marc-Andre ter Stegen had to be alert to keep out Hakan Calhanoglu, Patrick Cutrone and Suso.
At the other end, Donnarumma tipped a Malcom strike over and breathed a sigh of relief as a Sergi Roberto effort was deflected wide.
Referee Baldomero Toledo failed to spot a foul on Munir in the box but it looked like the fans would get to see some penalties anyway when Puig scuffed wide in the final minute of the game.
However, the 51,391 supporters in San Jose were denied a shootout when Milan broke to clinch the game at the death.