The 33-year-old striker, who plays for Flamengo in Brazil, had been provisionally suspended after failing a doping test following Peru's World Cup qualifier against Argentina in Buenos Aires in October.
World soccer's governing body said in a statement its Disciplinary Committee had found that Guerrero had violated article six of the organisation's Anti-Doping Regulations.
Cocaine is categorised as a stimulant and is included on the World Anti-Doping Agency (WADA) list of performance-enhancing substances.
World Cup Qualification CAF
Morocco and Tunisia qualify for 2018 World Cup
11/11/2017 AT 19:30
Peru qualified for the World Cup finals for the first time since 1982 by beating New Zealand in a two-legged playoff. Guerrero missed both of those matches.
His ban will be back-dated to Nov. 3 and will apply to international, domestic and official friendly fixtures.
World Cup Qualification CAF
Salah scores late penalty as Egypt qualify for World Cup with win over Congo
08/10/2017 AT 19:19
World Cup Qualification CAF
Iwobi goal sends Nigeria to World Cup as first African qualifiers
07/10/2017 AT 18:16