After the Declaration, Morelos moved to retake the city of Valladolid as a permanent seat for the Congress. The attack was a disaster. Morelos' army was defeated by future Mexican Emperor Agustín de Iturbide, and his general, Mariano Matamoros, was captured and executed. Morelos attempted to ransom Matamoros in exchange for 300 Spanish prisoners, a negotiation that failed. Morelos was ordered by the Congress to Acapulco to carry out the execution of the Spanish soldiers and then stripped of his command.