The ultimate guarantee of harmony was the ruler’s justness, which permitted him to enjoy the “mandate of heaven”; the people had a right, indeed an obligation, to rebel against a tyrant. But while the ethical basis of Neo-Confucianism was crucial, the Chinese also understood the need for a morally motivated bureaucracy, and thus perfected in the seventh century the world’s first examination system for selecting bureaucrats, with the Confucian canon as the syllabus.