The decision was announced less than six hours before kickoff of the match in La Paz and means Messi, the five-time world player of the year, will play in only one of Argentina's remaining five World Cup qualifiers.
His absence will be a severe blow to the two-time world champion who are struggling in the marathon South American campaign where results have included home defeats by Ecuador and Paraguay and a 3-0 mauling by arch-rivals Brazil.
Fifa said Messi had "directed insulting words at an assistant referee" during the 1-0 win over Chile on Thursday, in which he scored the only goal from a penalty.
Television pictures showed him swearing at Brazilian linesman Emerson Augusto do Carvalho at the end of the match after being harried and fouled by Chile's Jean Beausejour. The official patted him on the head and tried to calm him down but Messi kept ranting.
Fifa said in a letter to the Argentine Football Association, published by Argentine media, that the incident was not detailed in the referee's report at the time and was brought to its attention by the media.
Carvalho said he did not understand at the time what Messi was saying.
"I only realised he was swearing afterwards on reading the press," he said.
Messi, 29, will also miss games away to Uruguay and home to Venezuela and Peru. The Barcelona forward will be eligible again when Argentina visit Ecuador on Oct. 10.
Argentina are third in the 10-team South American group with 22 points from 13 games but have only a two-point cushion over sixth-placed Chile, with Colombia (21) and Ecuador (20) sandwiched in between.
The top four qualify directly for the tournament in Russia next year and the fifth-placed side go into a playoff against a team from Oceania for another place in the global showpiece event.
"This decision is in line with the Fifa Disciplinary Committee’s previous rulings in similar cases," Fifa said.
The Afa said it would appeal against the decision.
"Messi is sad, we lost an important player," said Afa national teams secretary Jorge Miadosqui.
Messi has not enjoyed the same success with Argentina as he has with Barcelona and announced his international retirement last year before back-tracking on his decision.
He also led a player media silence in protest at perceived mistreatment of the team.
Messi was frustrated when Argentina lost 1-0 after extra-time to Germany in the 2014 World Cup final, then on penalties to Chile in the 2015 Copa America final and again on spot-kicks to Chile in last year's Copa Centenario final.