Roberto Carlos joined Real Madrid in the year 1996 close season, where he was given the number 3 shirt and held the position as the team's first choice left-back from the 1996–97 season until the 2006–07 season. During his 11 seasons with Madrid, he appeared in 584 matches in all competitions, scoring 71 goals. He is Real Madrid's most capped foreign-born player in La Liga with 370 appearances, after breaking the previous record of 329 held by Alfredo Di Stéfano in January 2006. During his Real Madrid career, Roberto Carlos was, alongside Milan and Italy legend Paolo Maldini, considered the greatest left-back in the world. As a high-profile player and one of the most influential members of the team, Roberto Carlos was considered one of Madrid's Galácticos (which included Zinedine Zidane, Luís Figo, Ronaldo and David Beckham) during Florentino Pérez's first tenure as club president.
Roberto Carlos' next international tournament was the 2006 World Cup. In July 2006, after Brazil's 1–0 defeat to France in the quarter-finals, he announced his retirement from the national team, saying, "I've stopped with the national team. It was my last game." He said he no longer wanted to play for Brazil because of the criticism he faced from fans and Brazilian media for his failure to mark goalscorer Thierry Henry on France's winning goal.
Tactically, Roberto Carlos started out playing football in Brazil as a forward – usually as a centre-forward or outside forward –, but spent most of his career as defender, usually as a left–sided full-back or wing-back. In 2006, he was described as the "most offensive-minded left-back in the history of the game," by John Carlin of The New York Times; indeed, he was known for his forward surging runs throughout his career. Carlos is also widely considered by several pundits as one of the best left backs in the history of the sport. During his time at Inter, he was also used out of position as a winger in a 4–4–2 formation on occasion by manager Roy Hodgson, which had a negative impact on his performances, and often saw him caught out defensively; in his later career with Anzhi Makhachkala, he was instead deployed as a defensive midfielder in a three–man midfield, in order to compensate for his loss of pace and physical decline due to his advancing age.