Once the Americans had captured San Juan Hill the future of Santiago was a foregone conclusion, if the Americans just held on.
The end came suddenly however when Admiral Cevera was ordered to break his fleet out of the harbor. It was a suicide mission; the American fleet was far superior to the Spanish ships. On July 3rd the Spanish fleet sortied and all its ships were sunk in quick order. At that point the Spanish had no choice but to surrender Santiago.