ADDIS ABABA, Ethiopia (AP) — A court in Ethiopia has sentenced 23 people to up to 15 years in prison for establishing links to the al-Qaida and al-Shabab extremist groups.

The Ethiopian Federal High Court says they had been accused of planning to carry out terror attacks inside the East African country.

The state-affiliated Fana Broadcasting Corporate quotes the court ruling as saying three of those sentenced had been planning to establish an Islamic state.

Court officials say the defendants were active between 2010 and 2014 in six cities including the capital, Addis Ababa.

The charge sheet says the defendants recruited individuals and sent them to neighboring Somalia for training. Al-Shabab, which has links to al-Qaida, is based in Somalia.