Brazil to play Scotland ahead of Copa America
"This game will not only capture the imagination of the Scotland support but also the squad, who will relish the prospect of testing their skills against one of the finest international teams in world football," Scotland coach Craig Levein said in a statement.
Mano Menezes's Brazil team are preparing to defend their Copa America title in Argentina in July having lost their last two friendlies 1-0 to both Argentina and France.
"The opportunity to play Brazil was irresistible," added Levein.
Brazil also have a friendly at home on June 4 against the Netherlands, the South American team's conquerors in the 2010 World Cup quarter-finals in South Africa.