During the American Civil War, the South was strangled by a seemingly impenetrable Union naval blockade. Unable to ship cotton and tobacco out, the Confederates had no source of hard currency, but equally important, neither could they receive urgently needed imports.
Desperation is the evil mother-in-law of invention, and the South desperately tried a variety of techniques to break the Northern blockade: submarines, torpedoes, ironclads....the South tried them all. One of the problems was that the South had few shipyards capable of building modern naval vessels, and the few she possessed were frequently attacked by the Yankee navy--so the Confederacy had to have its ships built in Europe, instead.
Though several European countries hoped the North would either lose the war, or at least suffer enough military losses to stunt the growth of this enfant terrible, it was against international law for neutral nations to sell war materiel to belligerent countries. So the Confederates approached Napoleon III of France. The thinking seemed to be that, as emperor, he couldn't break the law because he was the law.
Napoleon III had no problem skirting the law, but he wanted what we call today, "plausible deniability." France would build two ship--supposedly for the Egyptian navy. And what ships they were--twin-screw-equipped, steam-powered, iron monsters, with giant sled rams on their bows. Capable of speeds of up to ten knots, and with heavy iron hulls, large cannons, and deadly bow rams--these ships were monsters that could easily break the American blockade of Southern ports.
Named Cheops and Sphynx, the two ships were all ready for delivery to the Confederates, when the United States discovered the plot and raised an official protest--so the ever-practical French simply sold the two ships elsewhere. Denmark and Prussia were at war, so the French (being French) sold one of the ships to each country.
The Cheops was renamed the Prinz Adalbert and was delivered to Prussia, while the Sphynx was renamed the Stærkodder. By the time the ships were finally delivered, the war was over. Sadly, the Prussian ship sat tied to a dock until she rotted, but the Stærkrodder, the Danish ship, had hardly begun her journey.
Though Denmark had accepted delivery of the ship, and was even conducting sea trials, the Danes haggled over the price. This fiscal battle continued until the French finally, secretly, approached the Confederacy to see if they were still interested in the ship. They were.
The ship quietly acquired a Confederate captain and crew, and while at sea, was rechristened the CSS Stonewall, and set sail for Portugal. (This is not the CSS Stonewall Jackson: that ship was a side-wheel riverboat.)
Along the way, two American warships either were scared off by the Stonewall, or were deliberately delayed by the Portuguese government--evidently in order to give the Stonewall a 24-hour head start across the Atlantic. There seems to be some confusion about the details, but Portugal and the US both decided to drop the incident after the Civil War, since one of the other "countries" involved no longer existed at that point. There is little reason to argue over who left the barn door open after the horses have run off.
So, the Stonewall sailed to Cuba, in order to take on coal and water before continuing on to Port Royal, South Carolina, where it was hoped she break the Yankee blockade and cut off the supply line for General Sherman. However, by the time the ship dropped anchor in Havana, the American Civil War was over. The Confederate captain, in need of funds for himself and his crew, sold the ship to the Spanish government for $16,000 (presumably not in Confederate dollars). (And, yes--that was a cheap price for a warship, even back then.)
The US demanded the ship, so the Spanish quickly avoided an international incident by selling the ship to the US Navy for the same price--$16,000. The ship was sailed up the Potomac River and tied to a dock. The US Navy eagerly inspected the vessel, but ultimately decided it had no real need for such a ship. So the Stonewall was again sold--this time, to Japan.
Japan was in the midst of its own Civil War. The last of the old Tokugawa Shogunate put $30,000 down and promised $10,000 on delivery, in order to obtain a modern warship to fight off the new Meiji Imperial Navy. However, by the time the ship was actually delivered, the port was now in the hands of the Imperial Navy, which eagerly paid the remaining $10,000 and used the new ship, (now renamed the Kōtetsu) against its enemy, the original Japanese purchasers. (To the reader: Have you lost count of the number of turnovers and sales, yet?)
The Kōtetsu was easily the most formidable ship of the Imperial Navy and sailed off to do battle with the remaining Shogunate navy at Hokkaido. Attempting to retake the fortress of a ship, the Shogunate disguised a rebel ship by flying an American flag on it until it was close enough to ram the Kōtetsu. Unfortunately, this tactic failed, since the deck of the Kōtetsu was nine feet lower than that of the ramming ship. One by one, samurai dropped from the bow of the attacking ship onto the deck of the ironclad, only to be slaughtered by a modern Gatling gun. (Never bring a sword to a machine gun fight!)
In the resulting engagement, the Battle of Hokodate, the Shogunate was destroyed. Firmly in control of Japan, the Meiji Empire built its modern Imperial Navy around the Kōtetsu, now renamed the Azuma. In later years, she became the flagship of Admiral Togo--who firmly believed that he was the reincarnation of Admiral Horatio Nelson.
But, that is another story.