Osaka (大阪, Ōsaka) is Japan’s second largest metropolitan area after Tokyo. It has been the economic powerhouse of the Kansai Region for many centuries. Osaka was formerly known as Naniwa. Before the Nara Period, when the capital used to be moved with the reign of each new emperor, Naniwa was once Japan’s capital city, the first one ever known.
In the 16th century, Toyotomi Hideyoshi chose Osaka as the location for his castle, and the city may have become Japan’s political capital if Tokugawa Ieyasu had not terminated the Toyotomi lineage after Hideyoshi’s death and moved his government to distant Edo (Tokyo). – (source : https://www.japan-guide.com/e/e2157.html)