Residency card

Hey guys. I will get right to the question, any help would be appreciated. I'm married in morocco to a moroccan, I have a criminal record in the United States from 10 years ago. We have a child in morocco. Am I able to get a residency card in morocco? Or will I be refused because of my criminal record? Surely they won't separate a family and deprive a child of her father....