The first president to enter into an undeclared war was former president Thomas Jefferson. During the administration of Jefferson, he waged a war against the Tripoli's Barbary pirates. This war was also known as the "Tripolitan war" which was considered the first of the two Barbary wars between the U.S., the four states of North Africa and Sweden.