 In 1657, he led an army of 40,000 men against King John II Casimir of Poland in the third part of the Second Northern War (1655-1660).He took Kraków and entered Warsaw with the Swedes, but the moment his allies withdrew, he was defeated by the Poles at Czarny Ostrów.Finally, the Poles allowed him to return to Transylvania.