Using a Ramsey-type setup, the lambda-doublet transition in the $J=1,, Omega=1$ level of the $a^3Pi$ state of CO was measured to be 394 064 870(10) Hz. In our molecular beam apparatus, a beam of metastable CO is prepared in a single quantum level by expanding CO into vacuum and exciting the molecules using a narrow-band UV laser system. After passing two microwave zones that are separated by 50 cm, the molecules are state-selectively deflected and detected 1 meter downstream on a position sensitive detector. In order to keep the molecules in a single $m_J^B$ level, a magnetic bias field is applied. We find the field-free transition frequency by taking the average of the $m_J^B = +1 rightarrow m_J^B = +1$ and $m_J^B = -1 rightarrow m_J^B = -1$ transitions, which have an almost equal but opposite Zeeman shift. The accuracy of this proof-of-principle experiment is a factor of 100 more accurate than the previous best value obtained for this transition.