Rubuta ci gaba ga wannan sakin layi - Rundunar Sojan Ruwa ta Amurka ta yi kokarin rufe tashar jiragen ruwa na Tripoli tare da rundunar da Shugaba Jefferson ya aiko a 1803. Bayan wasu nasarorin soja na farko, musamman kama jirgin ruwan Amurka mai suna USS "Philadelphia" a watan Oktoba na 1803, nan da nan Pasha ya sami kansa cikin barazana bayan wani hari da Leftenan Stephen Decatur na Sojojin Ruwa na Amurka ya jagoranta don ƙonewa da kuma lalata "Philadelphia" a tashar jiragen ruwa ta Tripoli. A shekara ta 1805, bayan shan kashi a yakin Derna
Kazalika da haɗin gwiwar da aka yi wa ɗan'uwansa Hamet Karamanli wanda aka yi wa ritaya da jami'in sojojin Amurka da kuma jami'in diflomasiyya William Eaton, an tilasta Karamanli ya mika wuya. Ya sanya hannu kan wata yarjejeniya tare da jakadan Amurka Tobias Lear na Ma'aikatar Harkokin Wajen Amurka wanda ya kawo karshen yakin a ranar 10 ga Yuni, 1805.