Provinces of Japan (令制国 Ryōseikoku?) were administrative divisions before the modern prefecture system was established, when the islands of Japan were divided into tens of kuni (国, countries), usually known in English as provinces. Each province was divided into gun (郡, districts, earlier called kōri).
The provinces were originally established by Ritsuryō as both administrative units and geographic regions.
In the late Muromachi period, however, their function was gradually supplanted by the domains of the sengoku daimyō. Under the rule of Toyotomi Hideyoshi, the provinces were supplemented as primary local administrative units. The local daimyōs' fiefs were developed.
In the Edo period, the fiefs became known as han. Imperial provinces and shogunal domains made up complementary systems. For example, when the shogun ordered daimyo to make a census or to make maps, the work was organized in terms of the boundaries of the provincial kuni.
At the Meiji Restoration, the han were legitimized as administrative units under Fuhanken Sanchisei, but were gradually replaced by prefectures between 1868 and 1871 (urban prefectures were called fu and rural prefectures ken). Provinces as part of the system of addresses were not abolished but, on the contrary, augmented. As of 1871, the number of prefectures was 304, while the number of provinces was 68, not including Hokkaidō or the Ryūkyū Islands. The boundaries between the many prefectures were not only very complicated, but also did not match those of the provinces. Prefectures were gradually merged to reduce the number to 37 by 1881; a few were then divided to give a total of 45 by 1885. Adding Hokkaidō and Okinawa produced the current total of 47 prefectures.