We report on the simultaneous observation of spontaneous symmetry breaking and long-range spatial coherence both in the strong- and the weak-coupling regime in a semiconductor microcavity. Under pulsed excitation, the formation of a stochastic order parameter is observed in polariton and photon lasing regimes. Single-shot measurements of the Stokes vector of the emission exhibit the buildup of stochastic polarization. Below threshold, the polarization noise does not exceed 10%, while above threshold we observe a total polarization of up to 50% after each excitation pulse, while the polarization averaged over the ensemble of pulses remains nearly zero. In both polariton and photon lasing regimes, the stochastic polarization buildup is accompanied by the buildup of spatial coherence. We find that the Landau criterion of spontaneous symmetry breaking and Penrose-Onsager criterion of long-range order for Bose-Einstein condensation are met in both polariton and photon lasing regimes.