Spectrum sensing is a key component in cognitive radio networks. The existing results so far primarily focus on single primary user detection. Little is known in the most practical and critical setting when multiple primary users exist. In this paper, the authors aim to address this problem by studying an optimal detector in the presence of multiple primary users. Specifically, a simple and accurate analytical formula for its test statistics distribution is derived, which yields a useful tool in determining the decision threshold. Simulations are provided to show both the accuracy of the derived result and the superior detection performance in realistic sensing scenarios.