By DPA
John Terry's second-half header looked to have given England a morale-boosting win, but Diego headed Gilberto Silva's cross past Paul Robinson to give Brazil a share of the spoils.
Chelsea defender Terry out jumped the Brazil defence at the far post to head home a free kick from the recalled David Beckham — seemingly the perfect boost going into next week's vital Euro 2008 qualifier in Estonia.
But Arsenal midfielder Gilberto, who had seen a goal being disallowed in the first half for offside – though television replays suggested it was a legitimate strike — sent in a cross two minutes into injury time and Diego stopped to head into the corner.
Despite the disappointment of not holding on for victory, coach Steve McClaren said he was delighted with the display.
"We got the performance, against a very, very good team," he said. "To nearly get a clean sheet, to be 15 seconds away, shows that as a team we defended well and we played good football as well."
All the talk in the build up to the match was about Beckham, who was back in the squad for the first time since he was dropped when McClaren took over from Sven Goran Eriksson after last summer's World Cup finals.
The former captain took his familiar position on the right of midfield and, along with one or two neat passes, it was his free-kick in the 68th minutes that found Terry, who powered in the opener.
McClaren praised the Real Madrid man's contribution.
"That (goal) was fitting. When David Beckham is playing well, there is no better right-sided player in the world.
"We wanted positives to go into the match with Estonia. I don't think you can get more positive than being 15 seconds away from beating a team like Brazil."
Brazil enjoyed by far the better of the game in terms of possession, with AC Milan's Kaka pulling the strings. But for all their flair and skill, they failed to create any clear-cut chances in the first half.
Michael Owen, making his first England appearance since the World Cup after almost a year out with a knee injury – worked tirelessly up front, while Steven Gerrard was named man of the match, sitting just in front of the back four.
England too had little of note in front of goal, but the game opened up after Terry's goal and Robinson saved well from a deflected shot by Ronaldinho, while Afonso headed over and also put the ball wide after a mistake by substitute Wes Brown.
At the other end, substitute Kieron Dyer caused the Brazil defence problems but it was the visitors who had the last laugh, with Diego finding space in the box and finishing well.