Complex sentence: Jose de San Martin, who had helped to liberate Chile and Argentina already, entered Peru in 1820; in 1821, the inhabitants of Lima invited him and his soldiers to the city.
Split into simpler sentences: Jose de San Martin, who had already helped to liberate Chile and Argentina, entered Peru in 1820. In 1821, the inhabitants of Lima invited him and his soldiers to the city.