In the 17th century Poland faced a series of wars starting with the Cossacks rebellion on the eastern frontier (Khmielnitzki's uprising of 1648), Moscovite invasion in 1654 and Swedish allied with the Brandenburg invasion and occupation (1655–1660). Even if the Swedes were driven back in 1657 and the Moscovites finally defeated in 1662, the Polish-Lithuanian Commonwealth lost nearly 1/3 of its population.