Treviño was appointed governor in 1675. Upon arriving in New Mexico, he took on the task of eliminating the native Pueblo religion. His knowledge of the religious practices was largely derived from Alonso de Posada's work, which detailed the aspects of shamanism. He ordered his troops to burn the kivas and idols of the Pueblo, and arrest 47 medicine men, who were accused of witchcraft and the murder of several missionaries. Three of them were hanged in Jemez, Nambé Pueblo, and San Felipe, while others were flogged, imprisoned, and publicly humiliated. When some of the Native American leaders heard of what had happened in the Pueblo villages, they sent their men to Santa Fe demanding the release of detainees. Taking advantage of the fact that most of the governor's soldiers were away fighting the Apaches, about 70 Native American warriors surrounded the governor's palace and stormed inside, capturing Treviño. In exchange for his freedom, Treviño freed the imprisoned men. Among the Pueblos who were released was the religious leader, Popé, who after his release, began planning a revolt against the Spanish. Upon receiving news that the Pueblos were again building kivas, Treviño ordered Franciscan missionaries to begin an investigation. On September 24, 1675, Treviño sent soldier Juan Dominguez de Mendoza to the Navajo lands leading a group of 40 Spanish men and 300 Pueblo auxiliaries. In the conflict, the troops killed and captured many Navajos, freed the Spanish and Pueblo prisoners, and destroyed other possessions. He renamed Zia Pueblo as "Plaza de Armas", and converted it to an assembly and mustering place for the Spanish troops. The New Mexican population also had troubles with the Apaches who destroyed agricultural lands and churches in New Mexico. In June 1676, Lieutenant GovernorTomé Mendoza was ordered to form an expedition against the Apaches who were attacking the Socorro and Senecú Pueblo areas. Juan de Mendoza was appointed as commander of these troops by Treviño. After two more years of governance in New Mexico, Treviño retired in 1679 and was replaced by Antonio de Otermin.