Commodore Matthew Perry arrived in Edo Bay with a squadron of four American warships, carrying a letter from President Franklin Pierce demanding trade and diplomatic relations. The Tokugawa shogunate, which had enforced strict isolation (sakoku) since the 1630s, had no navy capable of resisting the ships' guns. Perry's show of force set in motion the Convention of Kanagawa the following year and, ultimately, the collapse of the shogunate itself.
The Japanese called them 'kurofune' — black ships — and the sight of coal smoke belching from vessels moving without sails threw the shogunate into panic. Perry had specifically chosen to demonstrate steam power and modern naval guns, understanding that intimidation, not diplomacy, would open doors that centuries of Dutch traders confined to a single artificial island had failed to open.
Perry refused to deal with low-ranking officials, insisting he would only deliver President Pierce's letter to someone of sufficient rank, and threatened to sail further up the bay toward Edo itself if refused. He left after a few days, promising to return the following year for an answer — giving the shogunate time to panic further and debate helplessly, since no faction had a coherent plan for either resistance or accommodation.
When Perry returned in 1854 he got his treaty. Within fifteen years the shogunate had collapsed, replaced by the Meiji Restoration and a crash program of industrialization explicitly designed so Japan would never again face gunboats it could not answer in kind. Within two generations, Japan itself was building modern battleships and defeating a European power, Russia, in war.