Brazil extended their 92-year record of never losing an opening World Cup match, but only just, as they were held to a 1-1 draw by Morocco in Group C.
The result leaves the group finely balanced ahead of Haiti's meeting with Scotland later on Saturday.
Morocco's spirited performance suggests they can be a genuine threat in the tournament, while Brazil looked a long way from the finished article.
The African champions dominated the first half, exposing gaps in Brazil's midfield and scoring through Ismael Saibari in the 22nd minute.
Brazil hit back through Vinicius Junior's individual brilliance in the 32nd minute, but lacked their trademark swagger and struggled to break down Morocco's disciplined low block.
Brazil will play their next game against Haiti on June 20 in Philadelphia, while Morocco will take on Scotland on the same day at the Boston Stadium in Foxborough.