Before the adoption of the Meiji Constitution, Japan had in practice no written constitution. Originally, a Chinese-inspired legal system known as ritsuryō was enacted in the late Asuka period and early Nara period. It described a government based on an elaborate and rational meritocratic bureaucracy, serving, in theory, under the ultimate authority of the Emperor; although in practice, real power was often held elsewhere, such as in the hands of the Fujiwara clan, who intermarried with the Imperial Family in the Heian period, or by the ruling shōgun. Theoretically, the last ritsuryō code, the Yōrō Code enacted in 752, was still in force at the time of the Meiji Restoration.
Under this system, the Daijō-daijin (太政大臣, Chancellor of the Realm) was the head of the Daijō-kan (Department of State), the highest organ of Japan's pre-modern Imperial government during the Heian period and until briefly under the Meiji Constitution with the appointment of Sanjō Sanetomi in 1871. The office was replaced in 1885 with the appointment of Itō Hirobumi to the new position of Prime Minister, four years before the enactment of the Meiji Constitution, which mentions neither the Cabinet nor the position of Prime Minister explicitly. It took its current form with the adoption of the Constitution of Japan in 1947.
To date, 62 people have served this position. The current Prime Minister is Shinzō Abe, who re-took office on December 26, 2012. He is the first former Prime Minister to return to office since 1948, and the 3rd longest serving Prime Minister to date.