Cool...I "GOOGLED" -Lieutenant Presely N. O'Bannon - and ended up with the following but it still doesn't say why the Marine were there, how many and what about a Mediterranean ally force ("The battle of 1805 between Tripoli and American Marines
and their Mediterranean allies')
On April 27, 1805, Marine Corps forces lead by Marine Lieutenant Presely N. O’Bannon attacked and captured the fortress at Derna, Libya (then called Tripoli). The American flag was raised over the captured fortress. That was the first time ever the American flag had been flown over a territorial prize of war in the Eastern Hemisphere.
At the same time the United States of America treasury was paying as much as 1/5th of its total annual revenue to Tripoli and the Barbary Coast pirate states. This money was paid in part as ransom for captured American officials, and in part to allow the safe passage of American ships through the Mediterranean. The Basha (ruler) of Tripoli, unhappy about the amount of money Tripoli was receiving from the United States, declared war against the U.S. in May, 1801. A fleet of four ships was dispatched to patrol the waters around Tripoli and protect American shipping. However, their efforts were ineffectual. The battle of 1805 between Tripoli and American Marines and their Mediterranean allies, which almost ended in failure, resulted in replacing the Prince of Tripoli with his brother, who was more friendly to American interests.
The new Prince Karamali was so pleased with the American Marines; he awarded Lieutenant Presely O’Bannon a very special sword. This thin curved sword was the pattern for the current “Mameluke sword” carried by all Marine officers today as part of their dress uniform. As we all know our Marine Corp. March opening line “ From the Halls of Montezuma to the shores of Tripoli.
http://www.libyanet.com/n26jul99.htm