Thousands of migrants living in Morocco, including hundreds of refugees who fled wars in Africa, face a bleak dilemma -- whether to settle in this transit country with scant opportunities or brave the perilous journey to Europe.

"We do not know what to expect in the future," says Blessing, a 13-year-old Congolese girl, at a refugee centre in Rabat.

Morocco was hosting up to 25,000 sub-Saharan migrants at the end of 2012, the vast majority of whom at least initially were hoping to make it to Spain, non-governmental organisations say.

Gradually, however, the north African country is turning into a permanent home for these immigrants.

Among them are around 900 refugees, mostly Ivorians and Congolese who have fled wars back home, more than half of them women and children.

Refugee status granted by the UN refugee agency (UNHCR) gives them hope of rebuilding their lives.

But despite Morocco being the first Arab country to ratify in 1956 the Geneva Convention, their situation here is "fragile and ambiguous" in the absence of an adequate legal framework, the UNHCR's representative Marc Fawe told AFP on the occasion of International Refugee Day.

Without a residency permit "they are merely tolerated and cannot sign a rental or work contract," he said.

Despite these hurdles "Morocco is beginning to be treated as a final destination and not just a transit country," he said.

"The situation is better than in Mali where I first tried to settle," said Ronaldo, 16, who left Ivory Coast two years ago.

"We tried Cameroon and then Benin, but had no success. In Mauritania we stayed for a bit, but it's not the same as here," added Blessing.

At the gates of a Europe in crisis, Morocco at least offers the migrants stability, and there are some organisations to support them, such as the East-West Foundation which receives about 800 visitors annually.

"When migrants arrived in the early 2000s, Morocco was not ready and they were badly managed. But since then there has been a marked improvement and today we can carry out all our activities without any problems," said the foundation's president Yasmina Filali.

With the support of half a dozen local and international groups various assistance programmes have emerged, notably for schooling.

"Some have seen terrible things... (and so) school is a lifeline," said Filali.

After taking courses in Darija, or Moroccan Arabic, the children have a chance of being integrated in public schools, as was Blessing's younger sister -- she came "first in her class."

"This is a real success. In the past three years, 150 children have been integrated in all," Filali added.

But while there have been successes, there are also lot of real difficulties.

"Some are in very precarious situations. Only when they have been able to meet their basic needs can they concentrate on other things" like work, said Anna Prieur, a French volunteer with the UNHCR.

But it is impossible for them to find work outside the informal sector and sometimes the only means of subsistence is the modest aid provided by the UNHCR, which is reserved for the most vulnerable.

The UN agency says the kingdom "can do more," especially in offering the refugees legal status, which would enable them to look for regular work and protect them from predatory landlords.

Attending a "budget management workshop" organised by the Prieur, Ronaldo has mixed feelings about his stay in Morocco -- where he says he has experienced "discrimination" and an overbearing sense of loneliness.

"I came alone, I live alone, I'm always alone, even though I have found friends among the refugees," he said.

Trained in hotel management, he sees his life as being outside Africa.

"I believe this is just the first step," he adds.

But Blessing, the Congolese girl, is more upbeat.

"At first it was not easy, the environment, racist reactions, for example from proprietors. But over time we have learnt to integrate ... to avoid problems."

Some "could be fully integrated," said the East-West Foundation's Filali.

"But we remain a host country by default. There is always an attraction to Europe, even if the situation is not good here or there."