They said the three men were detained on Saturday at Marrakesh airport for holding fake Pakistani passports.
They were also carrying "suspect documents with jihadist contents", according to a statement issued by the interior ministry.
With North Africa on high alert since the militant beach massacre last Friday in Tunisia, the ministry said an investigation had uncovered an international recruitment network for militants and that the three Afghans would appear in court.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ