Roderic lived in ninth century Spain, during the time it was occupied by Moors. The conquerors had imposed a Muslim theocracy, but landed somewhere in the tolerance spectrum with regard to Christianity. Christians could live among them, and could even convert to Islam, but Muslims could not convert to Christianity. Apostasy Street only was clearly marked one-way.
Roderic eventually escaped from his brother, but the brother went to the authorities and complained that Roderic had apostatized. The priest was promptly arrested. His defense was that he had never declared himself a convert to Islam, but that was no defense at all in Moorish Spain so he was sent to prison to await execution.
The officials who handled the execution, by the way, were very thorough. They ordered that the pebbles which had been stained with the saints' blood be gathered up and thrown into the river to prevent Christians from gathering them as sacred relics. Now those folks were on the ball.