By 1778 the Lipan and other Apaches along the Rio Grande had become a major problem for the Spanish, and they began to consider the possibility of an alliance with the Wichita and Comanches against the Apaches. After several small military successes against Comanche raiders, Texas Governor Domingo Cabello y Robles sent Pedro Vial as an emissary to the Wichita villages in 1785 to discuss a peace agreement with the eastern bands of Comanche. By September they had agreed to a peace treaty which was signed in October at Bexar. In exchange for gifts and a promise of regular trade with Texas, the eastern Comanches agreed to help the Spanish fight the Lipan and to urge the western Comanches to make peace with New Mexico. As a result, New Mexico's war with the Comanches ended the following year.