In bacterial differentiation, mechanisms have evolved to limit cells to a single developmental pathway. The establishment of genetic competence in Bacillus subtilis is controlled by a complex regulatory circuit that is highly interconnected with the developmental pathway for spore formation, and the two pathways appear to be mutually exclusive. Here we show by in vitro and in vivo analyses that a member of the Rap family of proteins, RapH, is activated directly by the late competence transcription factor ComK, and is capable of inhibiting both competence and sporulation. Importantly, RapH is the first member of the Rap family that demonstrates dual specificity, by dephosphorylating the Spo0F-P response regulator and inhibiting the DNA-binding activity of ComA. The protein thus acts at the stage where competence is well initiated, and prevents initiation of sporulation in competent cells as well as contributing to the escape from the competent state. A deletion of rapH induces both differentiation pathways and interferes with their temporal separation. Together, these results indicate that RapH is an integral part of a multifactorial regulatory circuit affecting the cell's decision between distinct developmental pathways.