The first military land action overseas by the United States was executed by the US Marines and the US Navy at the Battle of Derna, Tripoli, a coastal town now in eastern Libya, in April 1805. It formed part of an effort to destroy all Barbary pirates, to free American slaves in captivity and end piracy acts between the warring tribes on the part of the Barbary states, which were themselves member states of the Ottoman Empire. The opening line of the "Marines' Hymn" refers to this action: "From the halls of Montezuma to the shores of Tripoli..." It was the first time that the US Marine Corps took part in offensive actions outside the United States.