What was the longest war the US has ever entered?

The longest war the United States ever entered was the Vietnam War.