After the successful Spanish conquest of the Inca Empire, the assassination of Francisco Pizarro in 1541, and the execution of his main antagonist, Diego de Almagro (1538) and his son, El Mozo (1542), most of the competent commanders of the recently founded New Castile Governorate had been lost in the ensuing power struggle. In 1540, second in line of the Pizarro brothers, Hernando Pizarro, returned to Spain to defend the question of his and his brothers' reign in Peru against accusations of abuse of power. He was eventually imprisoned on orders of King Charles. The Almagristas, followers of Diego de Almagro, met their downfall in the battle of Chupas on September 16, 1542. Two years later, King Charles eventually sent his own envoy, Blasco Núñez Vela, as governor over the recently found Viceroyalty of Peru, and as well to ensure the accomplishment of the New Laws enacted in 1542 to protect the native Peruvian population of Peru.
Gonzalo Pizarro, however, refused to relinquish power and the sovereignty over Peru once belonging to him and his brothers. With his namesake as an ensuring symbol of the former reign of the Pizarros, he gathered supporters, mainly opposed by formal governor of New Castile, Cristóbal Vaca de Castro, victor at Chupas over the Almagristas. The Viceroy arrived at Lima, new capital of Peru, and was sworn into office on May 17, 1544. He shortly after had Castro imprisoned and sent home to Spain. On September 18, Gonzalo Pizarro managed to depose Blasco Núñez Vela and sent him as prisoner to Panama. On October 28, the 1,200 men strong army of Gonzalo Pizarro entered Lima. Upon arrival to Panama, however, Vela was released, and returned to Peru with royal claims as the rightful viceroy and governor of Peru, landing in Tumbes. The two gathered supporters and met on January 18, 1546 at Añaquito in present-day Ecuador, superiority in numbers and firepower ensured victory for Gonzalo Pizarro, who crushed the army of Blasco Núñez Vela, who was decapitated on the field of battle. This, in its turn, ensured a struggle for the control of Peru between Gonzalo Pizarro and the royal forces.
The king then appointed Pedro de la Gasca as new governor of Peru; meanwhile, the land itself fell under control by Gonzalo Pizarro and his forces. De la Gasca landed in Peru in 1547, winning supporters to his initially inferior forces by promising amnesty to those having committed treason to the crown, and proclaimed he would not enforce the New Laws, whose dispositions demanding better conditions for native laborers had led many powerful encomenderos to join Pizarro's cause.
After initial skirmishes, the two forces went close to a confrontation in late 1547 at Jaquijahuana (Xaquixaguana, Sacsahuana) plains near Cuzco, but de la Gasca succeeded in avoiding battle, gaining precious time which he employed to convince even more of Pizarro's officers to switch sides, among them the notorious Alonso de Alvarado. Although Pizarro had arrived to Jaquijahuana with a vastly superior force, by the time the two sides finally met on the battlefield in April 1548, the situation had reversed, a steady string of defections having left Pizarro's forces in grave numerical inferiority and poor morale. The notorious conquistador Lope de Aguirre, known as the 'wrath of god', was injured by a harquebus shot to the leg at the battle while fighting for the royalists.
The battle itself proved to be a disaster for Gonzalo Pizarro, with all his men who hadn't already defected being killed or captured on the field, while de la Gasca's men reportedly suffered a single casualty. Gonzalo himself, along with his most loyal commander, Francisco de Carvajal, dubbed the Demon of the Andes, were captured on field of battle and executed by beheading. De la Gasca then made efforts to consolidate his control over Peru, which remained a royal colony and viceroyalty until the revolutionary actions of José de San Martín and Simón Bolívar during the early 19th century.