This small mosque is the only preserved monument before the Reconquest. We know that its construction dates back to the end of 999 thanks to an existing inscription on its front façade, which also says that the person in charge of its construction was Musa Ibn Ali, commissioned by a possible notable character of the time called Ibn Hadidí.
After the Reconquest at the hands of Alfonso VI the mosque was consecrated to Christian worship, attaching the striking apse decorated with blind arches. The interior of the temple is composed of nine small vaulted spaces, separated by four columns supporting horseshoe arches.
It was declared a National Monument in 1900.