A Polish Brethren, Niemirycz defended his fellow Arians in court and in parliament in the 1640s, and supported a fellow Protestant George II Rákóczi as candidate for the Polish-Lithuanian throne in 1648, when king Władysław IV Vasa died in the mist of war. Because of the Cossack Uprising of 1648 he had to evacuate his family to Warsaw, and took limited part in fighting against the rebellious Cossacks and serfs, advocating moderation (along the lines of Kiev voivode Adam Kisiel). He returned to his estates in 1649 but the massacre of Polish army by the Cossacks and Crimean Tatars at Batoh (Battle of Batih) in 1652 forced him to evacuate again, this time to his estates in Volhynia. During the Deluge, like many Polish–Lithuanian nobles and magnates (both Catholic and Protestant), he embraced the Swedish invaders in 1655, clearly in hopes of improving the Protestant position in the Commonwealth and reconquering his estates in the Ukrainian palatines. His pleadings for improvement of Polish Brethren cause with the Swedish king Charles X Gustav of Sweden failed and he eventually switched side to the Cossacks side. He took place in the preparation of the Treaty of Radnot (partition of the Polish–Lithuanian Commonwealth amongst five signatories: Charles X Gustav, György Rákóczi II of Transylvania, Frederick William, Elector of Brandenburg, Bohdan Khmelnytsky, and Bogusław Radziwiłł), signed in 1656. In 1657 he moved to Cossack Ukraine and Cossack hetman Khmelnytsky had his estates restored to him. He supported Ivan Vyhovsky, as Khmelnytsky's successor, and signed in Korsun, jointly with Ivan Bohun and Ivan Kovalivsky, an agreement between Sweden and Cossack Hetmanate in 1657.