During his 10-year-long presidency, Prieto expanded the governmental power and laid the foundation for a public administration in Chile. The first educational establishments like the "Instituto Nacional" were founded and in 1837 the ministries for justice and public education were created. Prieto's foreign policy was dominated by Chile's war with Peru between 1836 and 1839. The Chilean army under Manuel Blanco Encalada suffered heavy losses, which climaxed in the Treaty of Paucarpata, following which Manuel Bulnes took over the leadership of the army and led it into the victorious Battle of Yungay.