Entering the service at the age of eighteen, his first cruise was in the frigate, United States, which he was afterwards to command. He rose steadily in the service and got his first command six years later, being given the sixteen-gun brig Argus, and sent with Commodore Preble to assist in subduing the Barbary corsairs.

It is difficult to-day to realize that there was a time when the United States paid tribute to anybody, more especially to a power so insignificant as the Barbary States. Yet such was the fact. Lying along the north coast of Africa were the half-civilized states of Morocco, Tunis, Tripoli, and Algiers, and most of their income was from piracy. All merchantmen were their prey; they divided the loot and sold the crews into slavery. Many nations, to secure immunity from these outrages, paid a stated sum yearly to these powers, and the United States was one of them.

Why the nations did not join together and wipe the pirates out of existence is difficult to understand, but so it was. On one occasion, Congress actually revoked an order for some new ships for the navy, and used the appropriation to buy off the Barbary powers. The fund was known as the "Mediterranean Fund," and was intrusted to the secretary of state to expend as might be necessary. But after a while, the Barbary powers became so outrageous in their demands, that it occurred to the State Department that there might be another way of dealing with them, and a squadron under Commodore Preble was sent to the Mediterranean for the purpose.

Shortly before he reached there, the U.S. frigate Philadelphia, commanded by Captain Bainbridge, had gone upon a reef just outside the harbor of Tripoli and had been surrounded and captured, with all her crew, by the Tripolitan gunboats. The Tripolitans got her off the rocks, towed her into the harbor, and anchored her close under the guns of their forts. They also strengthened her batteries, and prepared her for a cruise, which could not but have been disastrous to our shipping. It was evident that she must be destroyed before she got out of the harbor, and Stephen Decatur volunteered to lead a party into the harbor on this desperate mission. Commodore Preble hesitated to accept Decatur's offer, for he knew how greatly against success the odds were, but finally, in January, 1804, he told him to go ahead.

A small vessel known as a ketch had recently been captured from the Tripolitans, and Decatur selected this in which to make the venture. He took seventy men from his own vessel, and, on the night of February 15, sailed boldly into the harbor of Tripoli. Let us pause for a minute to consider the odds against him. First there was the Philadelphia with her forty guns double-shotted and ready to fire; half a gunshot away was the Bashaw's castle, the mole and crown batteries, while within range were ten other batteries, mounting, all told, a hundred and fifteen guns. Between the Philadelphia and the shore lay a number of Tripolitan cruisers, galleys and gunboats. Into this hornet's nest, Decatur steered his little vessel of sixty tons, carrying four small guns, and having a crew of only seventy men.

The Tripolitans saw the vessel entering the harbor, but supposed it to be one of their own until it was alongside the Philadelphia. Then there was a cry of "Americanos!" and a rush to quarters, but it was too late, for Decatur and his men swarmed up the side and over the rail of the Philadelphia, and charged the dismayed and panic-stricken Tripolitans. There was a short and desperate struggle, and five minutes later, the ship was cleared of the enemy.

It was manifestly impossible to get the Philadelphia out of the harbor, so Decatur gave the order to burn her. Combustibles had been prepared in advance, and in a moment, flames began to break out in all parts of the ship. Then the order was given to return to the ketch, the cable was cut, the sweeps got out, and the ketch drew rapidly away from the burning vessel. The sounds of the mêlée had awakened the troops on shore, and, as the harbor was lighted by the flames from the Philadelphia, the shore batteries opened upon the little vessel, but without doing her any serious damage, and Decatur got safely out of the harbor and back to the fleet without losing a man.

Shortly afterwards his life was saved by one of those acts of heroism which stir the blood. In a general attack upon the Tripolitan gunboats, Decatur laid his ship alongside one of the enemy, grappled with her and boarded. Decatur was the first over the side and a desperate hand-to-hand combat followed. The pirate captain, a gigantic fellow, soon met Decatur face to face, and stood on tiptoe to deal him a tremendous blow with his scimitar. Decatur rushed in under the swinging sword, grappled with him, and they fell to the deck together, when another Tripolitan raised his scimitar to deal the American a fatal blow. A young sailor named Reuben James, himself with both arms disabled from sword cuts, seeing his beloved captain's peril, interposed his own head beneath the descending sword and received a wound which marked him for life. An instant later, Decatur's crew rallied to him, killed the pirate captain and drove the remainder of his crew over the side into the sea.

At the outbreak of the war of 1812, Decatur was given command of the United States, and on the morning of October 25, overhauled the British frigate Macedonian near the Canary Islands. Seventeen minutes later, the Macedonian, with a third of her crew dead, hauled down her colors. Decatur had lost only twelve men killed and wounded, and placing a crew aboard his prize, got her safely to New York. This victory was soon followed by disaster, for, securing command of the President, a frigate mounting forty-four guns, he attempted to get past the British blockade of New York harbor, but ran into a squadron of the enemy, and, after a running fight lasting thirty hours, was overhauled by a superior force and compelled to surrender. Decatur was taken captive to Bermuda, but was soon parolled, and, after commanding a squadron in the Mediterranean, built himself a house at Washington, expecting to spend the remainder of his days there in honorable retirement.

But it was not to be. In 1816, Decatur, while a member of the board of navy commissioners, had occasion to censure Commodore James Barron. Barron considered himself insulted, and a long correspondence followed, which finally resulted in Barron challenging Decatur to fight a duel. Under the code of honor then in vogue, Decatur could do nothing but accept, and the meeting took place at Bladensburg, Maryland, March 22, 1820. At the word "fire," Barron fell wounded in the hip, where Decatur had said he would shoot him, while Decatur himself received a wound in the abdomen from which he died that night. He was, all in all, one of the most brilliant and efficient men the navy ever boasted; and he will be remembered, too, for his immortal toast: "My country: may she be always right; but, right or wrong, my country!"