Greater of two evils

In 1644, Ming Dynasty general Wu Sangui was trapped at the Great Wall. Outside the wall was an invading Manchu horde, while behind the wall were peasant rebels who had overthrown the Ming Dynasty. He opened the gates, resulting in the Manchu conquest of China that caused 25 million deaths.