Moctezuma gave gifts in gold to the Spaniards. This was gold they had collected over centuries. But Cortes believed it was a sign of great wealth for the taking.
Then the Aztec nobles saw their ruler kept prisoner. They attacked the Spaniards who were forced to flee.
Cortes sent for reinforcements from Cuba, and then laid siege to the city. The Aztec also began dying of smallpox brought by the Spaniards.