Brazil won the trophy for the ninth time in a pulsating contest at the Maracana stadium.
The hosts took the lead against the run of play after 15 minutes.
Gabriel Jesus bamboozled two defenders on the right flank and crossed for the unmarked Everton to fire home from close range.
Peru equalised a minute before halftime when Paolo Guerrero scored from the penalty spot after Thiago Silva was adjudged to have handled the ball.
Jesus however restored their lead just moments later to put the home side 2-1 up at the break.
Peru pushed for a second goal, particularly after Jesus was sent off for a second yellow card in the 70th minute.
But it was Brazil who sealed the win in the final minute when substitute Richarlison converted a penalty kick.
It was Brazil’s first major title since they won the Copa America in 2007 and the first for coach Tite, who took charge three years ago.
With 15 titles Uruguay is the most successful Copa América team. Argentina has 14 titles and Brazil, nine. The other former champions are Paraguay, Peru and Chile, with two titles each, and Bolivia, and Colombia, who have each won one.