Retained in the navy reduction of 1801, Biddle served in the war against the Barbary pirates. The ship he was in, , struck rocks off Tripoli, and along with his commodore, William Bainbridge, he was kept imprisoned for 19 months.