The Magistrate is set during the rise and fall of the prosperous Tang dynasty. It tells the story of Li Yi, a modern grassroots civil servant whose soul transmigrates into Zhou Jing, a low-ranking village head from a poor family. As crises mount at the end of the Kaiyuan golden age, Zhou Jing uses extraordinary courage to drive change and ultimately rewrite the fate of the Tang dynasty.