Spectrum sensing is an important building block to realize the cognitive radio concept. In order to combat fading in the wireless environment, cooperation among the sensing users is usually employed. In this paper, we develop a closed-form optimal local decision threshold for cooperative spectrum sensing in cognitive radio systems via large deviation analysis. The resultant strategy is independent of the total number of cooperating users. We show that it is not only asymptotically optimal when the number of sensing users approaches infinity, but also can achieve the maximum diversity. Numerical results are provided to verify our analysis.