Koshi Province was an ancient province of Japan and is listed as one of the original provinces in the Nihon Shoki. The region as a whole was sometimes referred to as Esshū. In 701 AD, per the reforms of the Taihō Code, Koshi was divided into three separate provinces: Echizen, Etchū, and Echigo. However, in 702 AD, the four western districts of Etchū Province were transferred to Echigo Province. Etchū annexed Noto Province in 741 AD, but Noto was separated out again in 757 AD. In 746 AD, the noted poet Ōtomo no Yakamochi became Kokushi, and left many references to the region in the poetic anthology Man'yōshū. The Nara periodprovincial capital and provincial temple were located in what is now the city ofTakaoka, Toyama; however, there are four shrines which vie for the title of Ichinomiya two of which are located in Takaoka, one the city of Nanto and one in the town of Tateyama. Under the Engishikiclassification system, Etchū was ranked as a "superior country" in terms of importance and "middle country" in terms of distance from the capital. Despite this classification, Etchū never developed a powerful local gōzoku clan and was usually controlled by its more powerful neighbours. During the Muromachi period, the Hatakeyama clan emerged as shugo of the region, but preferred to remain in Kyoto, and to rule through appointed deputies, such as the Jinbō clan and the Shiina clan. Into the Sengoku period, the Hatakeyama transferred their power base to Nanao Castle in Noto province, and Etchū became an area contested by the Uesugi clan and the Oda clan with the Ikkō-ikki helping play one side against the other. The area was eventually conquered by Oda Nobunaga's general Shibata Katsuie and his deputy Sassa Narimasa, who were later replaced by Maeda Toshiie under the rule of Toyotomi Hideyoshi. The Maeda clan retained control of the province under Kaga Domain during the Edo periodTokugawa shogunate. During the mid-Edo period, Nei District and much of Niikawa District were separated from Kaga Domain into the 100,000 kokuToyama Domain, which was ruled by a branch of the Maeda clan. Following the Meiji Restoration and the abolition of the han system in 1871, Etchū Province was divided into Kanazawa Prefecture, Toyama Prefecture, Nanao Prefecture and Niikawa Prefecture, but these areas were reconsolidated into Ishikawa Prefecture in 1876. In 1883, Ishikawa Prefecture was divided, with the original four districts of Etchū Province becoming the new Toyama Prefecture. However, the name “Etchū Province” continued to appear in official documents afterwards for some administrative purposes. For example, Etchū is explicitly recognized in treaties in 1894 between Japan and the United States and between Japan and the United Kingdom.