The 25-year-old France-born Moroccan signed for the Clydesdale Bank Premier League side in October and impressed manager Jim Jefferies.
Jefferies said in the Daily Record: "There was a lot of interest in him as he did well for us. He had a few other offers to consider but he likes it here and is keen to work with us.
"By agreeing a two-year deal he has the chance to play regular football which is what he needs."