Commissioned a lieutenant in 1800, from late 1801 into 1803 Lieutenant Caldwell was an officer of the frigate "Constellation" during the initial phase of the war with Tripoli. In mid-1803, he returned to the Mediterranean in the brig "Siren" to participate in further operations against that piratical North African state. Caldwell distinguished himself in a boat action on 7 July 1804 and also took part in an attack on 3 August that resulted in the capture of three vessels that were taken into the Navy as gunboats. One of these, Gunboat Number 9, was under Caldwell's command when the U.S. squadron again bombarded Tripoli on 7 August 1804. While hotly engaged with an enemy battery, a hot shot penetrated her magazine and Gunboat Number 9 blew up. Lieutenant Caldwell and eleven others were killed or mortally wounded in the explosion.