On the morning of 29 December, USS Constitution was sailing in the Atlantic just off the coast of Brazil when sails were sighted on the horizon. Constitution's new captain, William Bainbridge, altered course to investigate; the ship proved to be HMS Java. Both frigates stood for each other and cleared their decks for action. After the initial hail from Bainbridge, Java answered with a broadside that severely damaged Constitution's rigging. Constitution was able to recover, and returned a series of broadsides to Java. At that point, Java's bowsprit became entangled in Constitution's rigging, allowing Bainbridge to continue raking Java with broadsides until her foremast collapsed, sending the fighting top crashing down two decks below. Drawing off to make emergency repairs, Bainbridge approached Java an hour later, and the British ship surrendered. Determining that Java was far too damaged to retain as a prize, Bainbridge ordered the ship burned.