Bloemfontein:Kaka scored a last-minute penalty on Monday to give Brazil a fortunate 4-3 win over Egypt in its opening game of the Confederations Cup.
Brazil had looked to be heading for a disappointing draw after Mohamed Shawky and Mohamed Zidan scored a goal each during one second-half minute, but Ahmed Al Muhamadi was sent off for using his arm to block a shot on the line and Kaka smashed in the penalty for his second goal of the match.
The win gave the record five-time World Cup winners three points in Group B, which also includes Italy and the United States.
Kaka, Luis Fabiano and Juan had earlier given Brazil a 3-1 halftime lead, but Egypt drew level through Shawky and Zidan, who scored Egypt's first goal early on.
Brazil will now almost certainly qualify for the second round of a tournament it has won twice, but the team will want an improved result and performance against the United States on Thursday.
Brazil coach Dunga blamed the poor performance on fatigue after his team played two World Cup qualifying games just before traveling several thousand kilometers (miles) to South Africa.
"Our team is really, really, very tired," Dunga said. "With our technical quality we were able to overcome it."
Brazil largely coasted against an opponent 35 places below it in FIFA's world rankings, with the only difference in the first half coming from three moments of individual inspiration.
The first came from Kaka on the edge of the area when the new Real Madrid playmaker stuck out a leg to collect a cross-field pass from Daniel Alves and instantly lifted it over defender Hani Said.
He looked to have flicked it too far but Said and Wael Gomaa failed to clear the loose ball and Kaka reacted quickest to calmly place a low shot past goalkeeper Essam El Hadary.
Zidan equalized for Egypt but striker Luis Fabiano restored Brazil's lead when he deftly headed Elano's 12th-minute free kick to help it from just inside the area.
Brazil's third standout moment was the dipping, swerving free kick by Alves that El Hadary punched out for a corner kick. Elano sent the corner over from the right for Juan to head in.