We have studied the local electronic structure of LaMn0.5Co0.5O3 using soft-x-ray absorption spectroscopy at the Co-L_3,2 and Mn-L_3,2 edges. We found a high-spin Co^{2+}--Mn^{4+} valence state for samples with the optimal Curie temperature. We discovered that samples with lower Curie temperatures contain low-spin nonmagnetic Co^{3+} ions. Using soft-x-ray magnetic circular dichroism we established that the Co^{2+} and Mn^{4+} ions are ferromagnetically aligned. We revealed also that the Co^{2+} ions have a large orbital moment: m_orb/m_spin ~ 0.47. Together with model calculations, this suggests the presence of a large magnetocrystalline anisotropy in the material and predicts a non-trivial temperature dependence for the magnetic susceptibility.