On 24 August, Charles X Gustav joined Wittenberg's forces. The Polish king John II Casimir left Warsaw the same month to confront the Swedish army in the west, but after some skirmishes with the Swedish vanguard retreated southwards to Krakow. On 8 September Charles X Gustav occupied Warsaw, then turned south to confront the retreating Polish king. The kings met at the Battle of Zarnow on 16 September, which like the next encounter at the Battle of Wojnicz on 3 October was decided for Sweden. John II Casimir was exiled to Silesia while Krakow surrendered to Charles X Gustav on 19 October. On 20 October, a second treaty was ratified at Kedainiai in the north. The Union of Kedainiai unified Lithuania with Sweden, with Radziwi recognizing Charles X Gustav as Grand Duke of Lithuania. Over the following days, most of the Polish army surrendered to Sweden: on 26 October Koniecpolski surrendered with 5,385 men near Krakow, on 28 October Field Crown Hetman Stanisaw Lanckoronski and Great Crown Hetman Stanisaw "Rewera" Potocki surrendered with 10,000 men, and on 31 October the levy of Mazovia surrendered after the Battle of Nowy Dwor.

Answer this question based on the article: What happened first: Charles X Gustav occupied Warsaw or Radziwi recognizing Charles X Gustav?
Charles X Gustav occupied Warsaw