During the early stages of their interactions, the Aztecs engaged in diplomatic negotiations with the Spanish. One reason for this was that the Spanish were seen as representatives, potentially, of the god of Quetzalcoatl, or the Toltec god-turned-king, who was widely believed to have returned one day.
Cortés took advantage of the Aztecs' initial hospitality and started consolidating his power within Tenochtitlan, forming alliances with some indigenous groups who were disgruntled with Aztec rule. However, as the intentions of the Spanish became more evident and their demands, such as tribute, increased, tensions rose between the Aztecs and the conquistadors.
Eventually, the Aztecs realized the true nature of the Spanish invasion and saw them as a serious threat to their civilization. As a result, they began to organize resistance and fight against the Spanish forces, leading to the eventual siege and fall of Tenochtitlan in 1521.