They had been captured by one of the pirate crews of the Dey of Algiers, and when they were taken ashore by these buccaneers they were stood up in the slave market and sold to Moors, or put to work in the shipyards. Other Yankee crews had met with the same treatment.

Now the United States had been paying its tribute regularly to the pirates, but in the spring of 1812 the Dey of Algiers suddenly woke up to the fact that the Americans had been measuring time by the sun while the Moors figured it by the moon, and found that in consequence he had been defrauded of almost a half-year's tribute money, or twenty-seven thousand dollars. He sent an indignant message to Tobias Lear, the American consul at Algiers, threatening all sorts of punishments, and Mr. Lear, taking all things into account, decided it was best to pay the sum claimed by the Dey. The United States sent the extra tribute in the shape of merchandise by the sailing vessel Alleghany; but the Dey was now in a very bad temper, and declared that the stores were of poor quality, and ordered the consul to leave at once in the Alleghany, as he would have no further dealings with a country that tried to cheat him. At almost the same time he received a present from England of two large ships filled with stores of war,—powder, shot, anchors, and cables. He immediately sent out word to the buccaneers to capture all the American ships they could, and sell the sailors in the slave-markets. The Dey of Algiers appeared to have no fear of the United States.

The truth of the matter was that his Highness the Dey, and also the Bey of Tunis, had been spoiled by England, who at this time told them confidently that the United States Navy was about to be wiped from the seas. English merchants assured them that they could treat Captain Smith and other Yankee skippers exactly as they pleased, since Great Britain had declared war on the United States, and the latter country would find herself quite busy at home. Algiers and Tripoli and Tunis, remembering their old grudge against the Americans, assured their English friends that nothing would delight them so much as to rid the Mediterranean of the Stars and Stripes.

The pirates swept down on the brig Edwin, and laid hands on every American they could find in the neighborhood. They stopped and boarded a ship flying the Spanish flag, and took prisoner a Mr. Pollard, of Virginia. Tripoli and Tunis permitted English cruisers to enter their harbors, contrary to the rules of war, and recapture four English prizes that had been sent to them by the American privateer Abellino. When the United States offered to pay a ransom of three thousand dollars for every American who was held as a prisoner the Dey replied that he meant to capture a large number of them before he would consider any terms of sale.

Our country was young and poor, and our navy consisted of only seventeen seaworthy ships, carrying less than four hundred and fifty cannon. England was indeed "Mistress of the Seas," with a great war-fleet of a thousand vessels, armed with almost twenty-eight thousand guns. No wonder that the British consul at Algiers had told the Dey "the American flag would be swept from the seas, the contemptible navy of the United States annihilated, and its maritime arsenals reduced to a heap of ruins." No wonder the Dey believed him. But as a matter of fact the little David outfought the giant Goliath; on the Great Lakes and on the high seas the Stars and Stripes waved triumphant after many a long and desperate encounter, and the small navy came out of the War of 1812 with a glorious record of victories, with splendid officers and crews, and with sixty-four ships. The English friends of the Barbary States had been mistaken, and Algiers, Tunis, and Tripoli began to wish they had not been so scornful of the Yankees.

It was time to show the pirates that Americans had as much right to trade in the Mediterranean as other people. On February 23, 1815, a few days after the treaty of peace with England was published, President Madison advised that we should send a fleet to Algiers. Two squadrons were ordered on this service, under command of Commodore William Bainbridge. One collected at Boston, and the other at New York. Commodore Stephen Decatur was in charge of the latter division.

Decatur's squadron was the first to sail, leaving New York on May 20, 1815. He had ten vessels in all, his flag-ship being the forty-four-gun frigate Guerrière, and his officers and crew being all seasoned veterans of the war with England. The fleet of the Dey of Algiers, however, was no mean foe. It consisted of twelve vessels, well armed and manned, six sloops, five frigates, and one schooner. Its admiral was a very remarkable man, one of the fierce tribe of Kabyles from the mountains, Reis Hammida by name, who had made himself the scourge of the Mediterranean. He had plenty of reckless courage; once he had boarded and captured in broad daylight a Portuguese frigate under the very cliffs of Gibraltar, and at another time, being in command of three Algerine frigates, had dared to attack a Portuguese ship of the line and three frigates, in face of the guns leveled at him from the Rock of Lisbon, directly opposite.

The city of Algiers itself was one of the best fortified ports on the Mediterranean. It lay in the form of a triangle, one side extending along the sea, while the other two rose against a hill, meeting at the top at the Casbah, the historic fortress of the Deys. The city was guarded by very thick walls, mounted with many guns, and the harbor, made by a long mole, was commanded by heavy batteries, so that at least five hundred pieces of cannon could be brought to bear on any hostile ships trying to enter.

Decatur's fleet was only a few days out of New York when it ran into a heavy gale, and the wooden ships were badly tossed about. The Firefly, a twelve-gun brig, sprung her masts, and had to put back to port. The other ships rode out the storm, and kept on their course to the Azores, keeping a sharp watch for any suspicious-looking craft. As they neared the coast of Portugal the vigilance was redoubled, for here was a favorite hunting-ground of Reis Hammida, and Decatur knew what the Algerine admiral had done before the Rock of Lisbon. They found no trace of the enemy here, however. At Cadiz Decatur sent a messenger to the American consul, who informed him that three Algerine frigates and some smaller ships had been spoken in the Atlantic Ocean, but were thought to have returned to the Mediterranean.

Decatur wanted to take the enemy by surprise, and so sailed cautiously to Tangier, where he learned that two days earlier Reis Hammida had gone through the Straits of Gibraltar in the forty-six-gun frigate Mashuda. The American captain at once set sail for Gibraltar, and found out there that the wily Algerine was lying off Cape Gata, having demanded that Spain should pay him half a million dollars of tribute money to protect her coast-towns from attack by his fleet.