 The third major fountainhead feeding into Japanese philosophy from ancient to contemporary times has been Buddhism. With origins in India going back to the fifth century bce, Buddhist philosophy like Confucianism entered Japan via Korea and China in the sixth and seventh centuries. In contrast with Confucianism, however, by the end of the eighth century Buddhism emerged as the major focus of Japanese creative philosophical development as imported Chinese Buddhist schools of thought were modified and new Japanese schools developed. Buddhism continued its intellectual dominance until the seventeenth century, then making way for the second wave of Confucian ideas that better suited the newly risen urbanized, secular society under the control of the Tokugawa shoguns. With notable exceptions, in the seventeenth through nineteenth centuries Buddhist intellectuals retreated from philosophical innovation to focus on institutional development, textual studies, and sectarian histories. When Western philosophy surged into modern Japan and its newly established secular universities, some influential Japanese philosophers saw Buddhist ideas as the best premodern resource for synthesis with Western thought. In some cases that entailed reformulating traditional Buddhist ideas in light of Western philosophical categories. In other cases, philosophers used allocation, relegation, or hybridization to create new systems that tried to assimilate Western ideas while maintaining aspects of traditional Japanese values. That said, in the modern era under the ideology of State Shintō, Buddhism as both a religion and a philosophy often suffered persecution and it was not until 1945 that it was once again completely free to develop its theories openly without government surveillance and censorship.