Conversation so far:
who was named protector of peru after liberating the country from spanish rule
On 12 July 1821, after seizing partial control of Lima, José de San Martín was appointed Protector of Peru
when was peru liberated
José de San Martín and his forces liberated Peru and proclaimed its independence from Spain on 28 July 1821

Question: who took the task of fully liberating the country
Self-contained rewrite: who took the task of fully liberating peru