When local people who lived along the coast resisted this invasion, Pizarro moved inland and founded the first Spanish settlement in Peru, San Miguel de Piura. After a series of maneuvres, Pizarro captured the Incan emperor Atahualpa at the Battle of Cajamarca in November 1532. A ransom for the emperor's release was demanded and Atahualpa filled a room with gold, but Pizarro charged him with various crimes and executed him in July 1533. The same year, Pizarro entered the Inca capital of Cuzco and completed his conquest of Peru. In January 1535, Pizarro founded the city of Lima.