 In 684, she accused him of treason and executed him.Pei Yan was from Jiang Prefecture (絳州, part of modern Yuncheng, Shanxi), and it is not known when he was born.When he was young, he became a student at the imperial university, and it was said that during vacations, the other students would often go out to travel, but Pei kept studying.