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
who took the task of fully liberating peru
Simón Bolívar took over the task of fully liberating Peru.

Question: why did the protector suddenly leave the country
Self-contained rewrite: why did jose de san martin suddenly leave peru