Islamist rebels attacked a prison in Somalia on Sunday and were fought off by security guards, who killed eight of the rebels, Somali Security Ministry spokesman Mohamed Yusuf told CNN.