In sequencing-by-synthesis systems, determining the order of nucleotides of a DNA fragment can be cast as an ML sequence detection (MLSD) problem. Solving it via exhaustive search is prohibitive even for relatively short DNA sequences. Symbol-by-symbol and partial-MLSD solutions are computationally feasible but sacrifice the optimal performance. In this paper, we modify the so-called sphere decoding algorithm to efficiently solve the MLSD problem in sequencing-by-synthesis systems. We analyze the expected complexity of the algorithm, and demonstrate via simulations that it significantly outperforms heuristic techniques.