The city now known as Osaka was at this time referred to as Naniwa, and this name and derivations of it are still in use for districts in central Osaka such as Naniwa () and Namba (). Although the capital was moved to Asuka (in Nara Prefecture today) in 655, Naniwa remained a vital connection, by land and sea, between Yamato (modern day Nara Prefecture), Korea, and China. Naniwa was declared the capital again in 744 by order of Emperor Shōmu, and remained so until 745, when the Imperial Court moved back to Heijō-kyō (now Nara). By the end of the Nara period, Naniwa's seaport roles had been gradually taken over by neighboring areas, but it remained a lively center of river, channel, and land transportation between Heian-kyō (Kyoto today) and other destinations. In 1496, Jōdo Shinshū Buddhists established their headquarters in the heavily fortified Ishiyama Hongan-ji, located directly on the site of the old Naniwa Imperial Palace. Oda Nobunaga began a decade-long siege campaign on the temple in 1570 which ultimately resulted in the surrender of the monks and subsequent razing of the temple. Toyotomi Hideyoshi constructed Osaka Castle in its place in 1583. Osaka was long considered Japan's primary economic center, with a large percentage of the population belonging to the merchant class (see Four divisions of society). Over the course of the Edo period (1603–1867), Osaka grew into one of Japan's major cities and returned to its ancient role as a lively and important port. Its popular culture was closely related to "ukiyo-e" depictions of life in Edo. By 1780, Osaka had cultivated a vibrant arts culture, as typified by its famous Kabuki and Bunraku theaters. In 1837, Ōshio Heihachirō, a low-ranking samurai, led a peasant insurrection in response to the city's unwillingness to support the many poor and suffering families in the area. Approximately one-quarter of the city was razed before shogunal officials put down the rebellion, after which Ōshio killed himself. Osaka was opened to foreign trade by the government of the Bakufu at the same time as Hyōgo (modern Kobe) on 1 January 1868, just before the advent of the Boshin War and the Meiji Restoration.