A sequential hypothesis testing, optimal stopping problem in underwater acoustic detection is formulated and solved using dynamic programming. The problem calls for deciding whether acoustic signals being received over long ranges in the ocean are due to a source or to ambient noise alone, so as to minimize the expected value of a specified cost function over a given time horizon. The cost function incorporates a constant cost per observation as well as terminal costs for false acceptance of either hypothesis. According to previous work by the authors, and without loss of generality, modeling the acoustic signals assumes a two‐state discrete‐time Markov process for each of the two hypotheses, the state of the process depending on whether the intensity of the signal at the receiver is above a specified threshold or not. The decision process presented is based on observations of the signal’s ‘‘interarrival times,’’ that is, the time intervals between two successive detection events. The algorithm is then extended into more than two alternative hypotheses (several ‘‘false’’ targets) and results using both simulated and experimental acoustic data for the two and three hypotheses cases are presented. Computational issues in implementing the algorithms as well as possible extensions of this work are finally discussed.