In Chinese History, legalism was one of the four main philosophic schools in the Spring and Autumn Period and the Warring States Period. It is actually rather a pragmatic political philosophy, with maxims like "when the epoch changed, the ways changed" as its essential principle, than a jurisprudence. In this context, "legalism" here can bear the meaning of "political philosophy that uphold the rule of law" and thus, distinguished from the word's Western sense. Hanfeizi believed that a ruler should govern his subjects by the following trinity:
Fa: law or principle. The law code must be clearly written and made public. All people under the ruler were equal before the law. Laws should reward those who obey them and punish accordingly those who dare to break them. Thus it is guaranteed that actions taken are systemically predictable. In addition, the system of law ran the state, not the ruler. If the law is successfully enforced, even a weak ruler will be strong.
Shu: method, tactic or art. Special tactics and "secrets" are to be employed by the ruler to make sure others don't take over control of the state. Especially important is that no one can fathom the ruler's motivations, and thus no one can know which behaviour might help them getting ahead; except for following the fa or laws.
Shi: legitimacy, power or charisma. It is the position of the ruler, not the ruler himself, which holds the power. Therefore, analysis of the trend, the context and the facts are essential for a real ruler.
Legalism was the central governing idea of the Qin Dynasty, culminating in the unification of China under the 'First Emperor' (Qin Shi Huang). Most Chinese philosophers and political thinkers have had very negative views toward Legalism blaming it for what today would be considered a totalitarian society. Many Chinese scholars believe that it was a reaction against legalism that gave Chinese Imperial politics its personalistic and moralistic flavor rather than emphasis on the rule of law. However, this view of the Qin may be biased, as Confucian scholars, who were persecuted under the Qin, wrote most of the Chinese historical records.
In later dynasties, Legalism was discredited and ceased to be an independent school of thought. However, both ancient and modern observers of Chinese politics have argued that some Legalist ideas have merged with mainstream Confucianism and still have a role to play in government.