大宝律令
The office of "Naidaijin" predated the Taihō Code of 701. Fujiwara no Kamatari was the first person appointed to the post in 669. After the appointment of Fujiwara no Michitaka in 989, the office became permanently established, ranking just below that of "Udaijin" ("Right Minister") and "Sadaijin" ("Left Minister").