Dundee United's unbeaten record against Barcelona was ended by a last-gasp goal by debutant Thierry Henry.
Henry came on to score on his debut
In the final minute, defender Darren Dods pulled down Giovani and Henry, on as a second-half substitute, stepped up to take the resulting penalty.
United's debutant goalkeeper, Grzegorz Szamotulski, saved the first effort, but Henry netted the rebound.
Barry Robson had a goal ruled out just before Henry struck, while Lee Wilkie had a header cleared off the line.
Barcelona nearly took the lead on 18 minutes when Ronaldinho's 25-yard free-kick rebounded off the far post.
Dundee United deserved a goal for the way they played
Barcelona coach Frank Rijkaard
Henry came on as a second-half substitute for Samuel Eto'o and came close to scoring within seconds of making his entrance, but his shot was just off target.
Afterwards, Barcelona coach Frank Rijkaard admitted United had deserved something from the game.
"It was a shame the public didn't see more goals and Dundee United deserved a goal for the way they played," he said.
"It seemed more than a friendly game, because there was lots of aggression and they gave us a very tough match."
United manager Craig Levein thought his side were hard done by when they conceded a penalty.
And he also thought that Robson's goal should have stood.
"I might have had my blinkers on for 90 minutes, but I thought it was a good goal that we scored and I didn't think it was a penalty either," he said.
"I thought it was a good game, but I am disappointed at the result.
"I would say that to take Barcelona within two minutes is a great sign for us, because they are a team of quality."