RIO DE JANEIRO, July 27 -- Former Brazil manager Luiz Felipe Scolari has been named coach of Palmeiras, signing a deal that ties him to the Sao Paulo club until after his 72nd birthday. Scolari replaces Roger Machado, who was sacked after Palmeiras' 1-0 defeat at Fluminense on Wednesday, a result that left them seventh in Brazil's 20-team Serie A standings. "Palmeiras have agreed to sign the coach Luiz Felipe Scolari .... [who] has signed a deal with the club until 2020," the club said in an official statement. It will be Scolari's third time in charge of the nine-time Serie A champions. He led them to the 1998 Brazilian Cup and 1999 Copa Libertadores title - South American football's top club trophy - during his first spell in charge and again lifted the Brazilian Cup during his second stint in 2012. The 69-year-old has not coached in his homeland since the 2014 World Cup, when Brazil suffered a humiliating 7-1 loss to Germany in the semifinals. He was also in charge of the Brazil team that won the 2002 World Cup in Japan and South Korea. Scolari's last coaching job was with China's Guangzhou Evergrande, where he won seven titles before parting ways with the club in November last year.