Shortly after Shuyski was removed, both Żółkiewski and the second False Dmitri arrived at Moscow with their separate armies. It was a tense moment, filled with the confusion of the conflict. Various pro- and anti-Polish, Swedish, and domestic boyar factions vied for the temporary control of the situation. The Russian army and the people themselves were unsure if this was an invasion and that they should close and defend the city, or if it was a liberating force that should be allowed in and welcomed as allies. After a few skirmishes, the pro-Polish faction gained dominance, and the Poles were allowed into Moscow on 8 October. The boyars opened Moscow's gates to the Polish troops and asked Żółkiewski to protect them from anarchy. The Moscow Kremlin was then garrisoned by Polish troops commanded by Aleksander Gosiewski. On 27 July a treaty was signed between the boyars and Żółkiewski promising the Russian boyars the same vast privileges the Polish szlachta had, in exchange for them recognizing Władysław as the new tsar. However, Żółkiewski did not know that Sigismund, who remained at Smolensk, already had other plans.