A contemporary depiction of the 98-gun HMS Temeraire by renowned marine artist Geoff Hunt. Geoff Hunt RSMA/Art Marine, UK

At Penn's Landing in Philadelphia, the battle-cruiser USS Olympia lies glorious and doomed. The oldest steel warship in the world today, she has a poignant history. In 1898, during the Spanish-American War, she was Adm. Dewey's flagship at the battle of Manila Bay, and in 1921 she carried the body of the first officially designated Unknown Soldier, felled in World War I, back from France to the U.S. The Olympia is magnificent. If nothing is done to save her, she will be towed offshore and sunk as an artificial reef.

Sam Willis's "The Fighting Temeraire" is an elegant lament for the vanished warships of the world and an eloquent plea for the preservation of those still afloat, so that they will not meet the fate of the HMS Implacable. In 1949, the British towed Implacable out to sea and sank her with explosives. She had originally been named the Duguay-Trouin and was captured from the French navy at the battle of Trafalgar in 1805. By 1949 there was no money available for her preservation. And so, flying the flags of Britain and France, she went to her doom.

The Temeraire, the central subject of Sam Willis's discursive and fascinating book, was also at Trafalgar. Despite her French name, which translates as "reckless" or "rash," she was a British ship, built from more than 5,000 English oak trees and launched in 1798. She was named for a previous Temeraire, which had been captured by the Royal Navy at the battle of Lagos Bay in 1759.

The Fighting Temeraire

By Sam Willis
Pegasus, 323 pages, $28.95

The new Temeraire was to have a long and distinguished history, but by 1839 she was obsolete; and so she was towed to a breaker's yard and dismembered. We might have forgotten her except that J.M.W. Turner painted an iconic canvas—"The Fighting Temeraire"—that today hangs in London's National Gallery. The picture shows the vast dusk-gilded hull of the great battleship being towed up the Thames by a squat, steam-powered paddle-wheel tug. All the glory of the past is being dragged to oblivion beneath the cloud-haunted light of a setting sun. It is a picture that tells a story, and it is consistently voted Britain's favorite painting.

The beauty and romance that move us hide a darker tale, of men crammed into airless decks, of the stench of powder and sewage, of blood and cruelty, although there is glorious history, too. Between 1793 and 1815 the Royal Navy lost five battleships and 16 frigates to enemy action (notably to the formidable U.S. Navy), but they sank or destroyed 92 enemy battleships and 172 frigates.

By 1839, when Turner painted the doomed Temeraire, the men who had fought that war and won Britain its pre-eminence at sea were fading away, and the ships themselves were outdated and expensive to maintain. A new world dawned, one dominated by the smokestack and the stink of coal, and Turner's canvas touched a nostalgic nerve. It inspired poetry, including one tribute from, of all people, Herman Melville. The painting also made the Temeraire famous.

She deserved her fame. The three-decker was one of the most powerful ships in the Royal Navy. Her greatest day came on Oct. 21, 1805, when she followed Nelson's Victory into the melee at Trafalgar, where her 98 guns saved the British flagship, even if they could not save Nelson's life.

The Victory had been engaged by the Redoutable, undoubtedly the best-trained ship in France's navy. Redoutable was locked to the Victory when the Temeraire sailed slowly past her stern and raked a broadside lengthwise down the Frenchman's hull, killing almost a third of her crew with that opening blow. The Temeraire then went alongside the wounded Redoutable, only to be sandwiched there by a second Frenchman, the Fougueux. Yet the Temeraire outfought both and forced each to surrender. The Temeraire had 47 of her 755 crew killed, but the Redoutable lost an extraordinary 487 dead out of 643 men, a fearsome tribute to the skilled gunnery of Britain's sailors.

Sam Willis tells that story and others, beginning with the first Temeraire and her capture during the Seven Years' War. What follows is a cruise through Britain's naval history in the late 18th and early 19th centuries, with wonderful side trips to describe ship construction and the subtleties of naval design or to dissect the mutinies that threatened the Royal Navy's supremacy. Anyone who has the smallest interest in naval history will treasure this book.

We are lucky that we still possess HMS Victory, Nelson's flagship at Trafalgar and a near-twin of the Temeraire. She lies in dry dock now, her great masts rearing above Portsmouth dockyard. HMS Warrior, Britain's first ironclad battleship, built in 1860, is moored nearby, while in Boston, of course, the USS Constitution still floats and is wonderfully preserved.

Those ships are, for the moment, safe. But Turner's painting and Mr. Willis's book remind us that fame and glory are not sufficient protection against an empty budget, and it will be tragic if we allow the Olympia to follow the Implacable to a watery grave. It is not too late. At Penn's Landing, in the impecunious care of the Independence Seaport Museum, we possess a precious fragment of America's naval history, and we can only hope that, 170 years from now, no one who writes the Olympia's biography will have to end it with the tale of her destruction.

—Mr. Cornwell is the author of the Richard Sharpe series of Napoleonic-era novels. His latest book is "The Fort: A Novel of the Revolutionary War."