From Dawn Like Thunder (Annotated): The Barbary Wars and the Birth of the U.S. Navy, by Glenn Tucker (Corsair Books, 2019), Kindle Loc. ~2750:
Captain Sterrett bore a British flag as he approached the Tripolitan ship, an expedient frequently practiced in the naval warfare of the day. He inquired of the Tripolitan the object of her cruise. The commander replied that he had come out to look for Americans but lamented that he had not yet found a single one. Sterrett promptly lowered the British and hoisted the U.S. colors and ordered a volley of musketry discharged across the Tripolitan’s decks.
The Tripoli replied with a partial broadside. It was 9:00 a.m. For three hours the ships lay alongside at pistol range and blazed away at each other with broadsides and small arms. Three times they came together and the Muslims tried to board. Each time they were beaten back with severe loss.
Fortunately the Enterprise had a small Marine Corps detachment, commanded by Lieutenant Enoch S. Lane, whose fire was particularly effective during the boarding efforts. An equal number of times the Tripolitans seemed to give up the contest and surrender. They struck their colors, but each time as the wary Lieutenant Sterrett drew close for boarding and as the American gun crews relaxed their efforts, came to the spardeck and cheered for their victory, the enemy ship hoisted her flag again, let loose a blast and renewed the battle. After the last deception Sterrett ordered the gunners to sink the craft, whose fire had grown steadily weaker under the unmerciful bombardment from the American guns. The seamen took up the cry of “Sink the villains.”
Finally the unhappy and treacherous Admiral Rais Mahomet Rous, who like his second in command was wounded, called out for mercy. He bent over the vessel’s waist in a supplicating position which appeared to be a genuine surrender.
Sterrett, not to be duped by further trickery, held his fire but told the commander to come aboard the Enterprise or send some of his officers. The Admiral replied that the Tripoli’s boat was so shattered it was unfit for use.
Sterrett then inquired what assurance he would have that his men would not be murdered if he sent a detail aboard the Tripoli. The Admiral threw his colors into the sea. After that and other supplications and assurances, the American commander decided to take the risk. When the boarding party headed by Lieutenant Porter reached the enemy deck it found a scene of death and desolation almost unparalleled in such small ship actions.
The ship was shot to pieces. Of her eighty men thirty were dead and thirty wounded, leaving but twenty to man the ship. The deck was covered with bodies, splinters, blood, and wreckage. The ship’s surgeon had been killed and there was no one on board to care for the wounded. With the two top officers wounded and the third officer dead, the distressed vessel was virtually out of control.
But the strange feature of this battle fought for three hours at close pistol range, with the two ships often lying alongside, was that when Captain Sterrett checked the American gunners, marines, and seamen, not an American had received a single scratch.
The reason can only be guessed at; partly chance, but mainly because the Barbary powers who were accustomed to boarding defenseless merchant vessels were not fitted by training or temperament for the fierce, desperate, pent-up fury of sea actions in the era of “iron men and wooden ships,” in which, for some reason, the Americans of that day seemed to excel.