Family · Moudawana · 12 min read

Child custody in Morocco (hadana): who gets it, visiting rights, travel and loss of custody

Hadana in Morocco: order of custodians, conditions, the mother's remarriage, moving house, visiting rights, travel abroad, the child's choice at 15 and failure to return a child.

Checked against the official texts on November 28, 2026

After a separation, the question that comes up most often is not about money. It is about the children: who will they live with? When can the other parent see them? Can they be taken abroad? What happens if the mother remarries?

The Family Code (the Moudawana) answers these questions in a whole part devoted to custody, called hadana in Arabic (الحضانة). Our article on divorce in Morocco gives an overview. Here we go into detail, article by article, in plain words and with examples.

One idea guides all these rules: the best interests of the child. Article 186 requires the court to take it into account in every case. Keep it in mind, it explains almost everything that follows.

What is custody and how long does it last?

Article 163 defines custody as protecting the child from anything that could harm them, bringing them up and looking after their interests. The person who has custody (the custodian) must, as far as possible, take the steps needed for the child's physical and emotional safety.

As long as the couple is married, custody belongs to both parents together (Article 164). So the question of who has custody only really arises after a divorce or separation.

Custody lasts until legal majority, for boys and girls alike (Article 166). Legal majority is 18 full Gregorian years (Article 209). There is no difference between sons and daughters on this point.

Beware of an important distinction. Custody is not the same as legal guardianship (wilaya). The custodian cares for the child day to day. The legal guardian represents the child in legal matters and important decisions. Under Article 236, the father is by law the legal guardian of his children unless a court judgment has removed this guardianship. If the father is unable to act, the mother may handle the children's urgent matters. The law often calls this guardian the legal representative. You will see the term again, especially about travel.

Key ages and periods in custody
18 yearscustody ends, for boys and girls alike (Art. 166 and 209)
15 yearsage from which the child may choose between father and mother (Art. 166)
7 yearsup to this age, the mother's remarriage does not make her lose custody (Art. 175)
1 yearsilence after which a person entitled to claim custody loses that right once they know the custodian's marriage was consummated (Art. 176)

Who gets custody? Order of priority and conditions

The order set by law

Article 171 sets a clear order. Custody goes first to the mother, then to the father, then to the maternal grandmother. If none of them can take it on, the court chooses, based on the evidence before it and in the child's interest, the most suitable close relative.

And if no one accepts custody, or the candidates do not meet the conditions? Article 165 provides that the persons concerned or the public prosecutor refer the matter to the court. The court chooses the most suitable person among the child's relatives or outside the family. Failing that, it entrusts the child to an approved institution.

Order of priority for custody (Art. 171 and 165)
  1. The motherfirst in line for custody
  2. The fatherif the mother cannot or will not take it on
  3. The maternal grandmotherthird in line
  4. A close relativechosen by the court as the most suitable
  5. Another person or an institutionif no relative is suitable, by court decision

Conditions for being a custodian

Being first in line is not enough. Article 173 sets four conditions:

  • being of legal age, except for the father and mother;
  • integrity and honesty;
  • being able to bring up the child, protect them religiously, physically and morally, and follow their schooling;
  • for a woman seeking custody, not being married, except in the cases set out in Articles 174 and 175 (see below).

To check all this, the court may ask a social worker for a report on the custodian's home and on how they meet the child's material and emotional needs (Article 172).

Custody, housing and money: who pays for what?

Custody has a cost, and the law shares it out.

First, the custody allowance and related costs are paid by the person who owes the child's maintenance (Article 167), in practice usually the father. This allowance is separate from child maintenance (nafaqa) and from the breastfeeding allowance. The mother is not entitled to it during the marriage, nor during the idda (waiting period) of a revocable divorce.

Next, the child's housing is a separate item (Article 168). The father must provide housing for his children or pay the rent set by the court. A very protective point: the child cannot be made to leave the marital home until the father has complied with the judgment on housing. The court must also set out in its judgment measures to make sure the father keeps complying. Article 171 adds that decent housing for the child is part of the maintenance obligations.

Finally, if the custodial mother remarries and keeps custody, the father no longer has to pay the child's housing costs or the custody allowance. But he must still pay the child's maintenance (Article 175).

For how maintenance itself is calculated and collected, see our article on divorce and maintenance.

When can custody be lost?

We speak of loss of custody (souqout al-hadana) when the custodian loses the right. The law sets out several cases.

A change that harms the child

If the custodian's situation changes in a way likely to harm the child, they lose custody. It passes to the next person in the order of priority (Article 173, last paragraph).

The custodian's marriage

This is the most common question. The law distinguishes two situations.

If the custodian is not the mother (a grandmother, an aunt and so on), her marriage makes her lose custody, unless her new husband is a relative of the child whom the child could not marry (a mahram relative) or the child's legal representative, or unless she herself is the child's legal representative (Article 174).

If the custodian is the mother, her remarriage does not make her lose custody in four cases (Article 175):

  • the child is not over 7, or separation from the mother would harm the child;
  • the child has an illness or disability that makes custody difficult for anyone other than the mother;
  • the new husband is a mahram relative of the child or the child's legal representative;
  • the mother herself is the child's legal representative.

There is also a time limit to watch. A person who could claim custody and stays silent for one year after learning that the custodian's marriage was consummated loses that right, except for compelling reasons (Article 176).

Moving house

Moving within Morocco does not, as a rule, lead to loss of custody (Article 178). The court may nevertheless order it if it has established grounds, taking into account the child's interest, the situation of the father or legal representative, and the distance between the child and their legal representative.

Breaches of visiting rights

A custodian who blocks visits or cheats in carrying them out risks measures by the court, which can go as far as loss of custody (Article 184).

Custody is never set in stone

If the obstacle that caused the loss of custody disappears, the person concerned recovers the right. And the court can always review who has custody in the child's interest (Article 170).

Document generatorApplication for forfeiture of the right of custody (hadana)16 MAD

Visiting rights: by agreement or by court decision

The father or mother who does not have custody has the right to visit the child and to have the child stay with them (Article 180). It is a right, not a favour.

First, the parents' agreement

The father and mother can agree on how visits will work. They inform the court of their agreement, and the court records its content in the custody decision (Article 181). This is often the best solution: each parent knows their schedule, the school and the holidays.

Otherwise, the court decides

If the parents cannot agree, the court itself sets the visiting periods, times and place in the custody decision, so as to prevent, as far as possible, any trickery in carrying it out (Article 182). It takes account of each party's situation and the circumstances of the case. Its decision can be appealed.

A rule worth knowing: the child only spends the night at the custodian's home, unless the judge decides otherwise in the child's interest (Article 169). So if you want to have the child for a whole weekend, the decision must provide for it.

Organising or changing visiting rights
  1. Seek an agreementset the days, times, places and holidays together
  2. Send the agreement to the courtit is recorded in the custody decision (Art. 181)
  3. Otherwise, let the court decideit sets the periods, time and place (Art. 182)
  4. Appeal if neededthe decision on visits can be challenged (Art. 182)
  5. Ask for a reviewif new circumstances make the arrangement harmful (Art. 183)

Changing visits when life changes

A move, a new job, a child growing up… If new circumstances make the visiting arrangement harmful to one of the parents or to the child, a review can be requested (Article 183).

Document generatorApplication for organization or revision of visitation rights16 MAD

And if a parent dies?

Grandparents are not forgotten. If the child's father or mother dies, that parent's own parents (the child's grandparents) take their place in visiting rights (Article 185).

Custodial parent and non-custodial parent
Custodial parentNon-custodial parent
Lives with the child, who spends nights there unless the judge decides otherwise (Art. 169)Visits the child and has the child stay as set by the agreement or decision (Art. 180)
Looks after the child's safety, upbringing and schooling (Art. 163 and 169)The father or legal guardian also looks after upbringing and school guidance (Art. 169)
May receive a custody allowance, except during the marriage and the idda of a revocable divorce (Art. 167)Whoever owes maintenance pays it and the custody allowance, and the father pays for housing (Art. 167 and 168)
Risks losing custody if they obstruct visits (Art. 184)May ask for a review of visits or for court measures (Art. 183 and 184)

Travelling abroad with the child

This is a frequent worry, especially when one parent lives abroad. Article 179 sets out a precise mechanism.

At the request of the public prosecutor or the child's legal representative, the court may forbid the child from being taken out of Morocco without the consent of the legal representative. This ban may be included in the custody decision itself or in a later decision. The public prosecutor then notifies the competent authorities so that it is enforced.

And the other way round? If the legal representative refuses to consent to a trip, an application can be made to the urgent applications judge for permission. The judge will only grant it once satisfied that the trip is temporary and that the child's return to Morocco is guaranteed.

Document generatorApplication for a child's prohibition from leaving the territory13 MAD

The child's choice from age 15

Once the parents' marriage has ended, a child who has turned 15 may choose whether the father or the mother will have custody (Article 166). The child's voice really counts.

If neither father nor mother is available, the child may choose one of the close relatives listed in Article 171. Two conditions apply: the choice must not go against the child's interest, and the legal representative must agree. If the representative refuses, the judge decides according to the minor's interest.

Ask the assistant« My son is 15 and wants to live with his father after our divorce, how does it work? »Sourced answer

Protecting the child: the public prosecutor and failure to return a child

Reporting a danger

Article 177 is little known. The father, the mother, relatives and indeed anyone else must inform the public prosecutor of any harm suffered by the child in custody. The prosecutor then takes the necessary steps to protect the child's rights, and can even ask for loss of custody.

The public prosecutor also acts elsewhere: it can refer the matter to the court when no one can take custody (Article 165) and can request a ban on leaving the country (Article 179).

Document generatorReport to the public prosecutor of harm suffered by a child in custody8 MAD

When the child is not handed back

Keeping the child after a visit, or refusing to hand the child over to the other parent, is not just a family dispute. Under Article 477 of the Criminal Code, where a court decision on custody is final or provisionally enforceable, the father, the mother or anyone who fails to hand the child over to those entitled to claim them, or who takes the child away from the custodian, even without deceit or violence, faces one month to one year in prison and a fine of 200 to 1,000 dirhams. Prison can rise to three years if the offender had been stripped of parental authority.

Before acting, keep evidence: the custody decision, the dates of missed visits, the messages exchanged. In a real case, a lawyer can help you choose between a criminal complaint and an application to the family judge, or combine both.

Templates for child custody and visits

See all templates

Key takeaways

  • Custody (hadana) lasts until 18, for girls and boys alike.
  • The order is: mother, then father, then maternal grandmother, then the relative chosen by the court.
  • The custodian must meet the conditions of Article 173; a change that harms the child leads to loss of custody.
  • The mother's remarriage does not make her lose custody in the cases of Article 175, for example if the child is not over 7; anyone wishing to claim custody must act within a year.
  • The non-custodial parent has visiting rights, set by agreement or by the court, and open to review.
  • The court may ban the child from leaving the country; the urgent applications judge may allow a temporary trip.
  • At 15, the child chooses between father and mother.
  • Failing to hand over a child despite a court decision is a criminal offence (Article 477 of the Criminal Code).

The full texts are available on Adala , the official legal portal of the Ministry of Justice, and in the Haqia text database.

Frequently asked questions

Does the father get custody if the mother remarries?

Not automatically. Under Article 175 of the Family Code, the mother's remarriage does not make her lose custody if the child is not over 7 or would be harmed by the separation, is ill or disabled, if the new husband is a mahram relative or the child's legal representative, or if the mother is the legal representative. Outside these cases, the father can apply for custody, but he must act within one year of learning that the marriage was consummated (Article 176). The court always decides according to the child's interest.

Until what age does custody last in Morocco?

Until legal majority, that is 18 full Gregorian years, for boys and girls alike (Articles 166 and 209). From age 15, once the parents' marriage has ended, the child can choose to live with the father or the mother.

Can the mother travel abroad with the child without the father's consent?

If the court has ordered a travel ban, the child cannot leave Morocco without the consent of the legal representative, who is in principle the father (Articles 179 and 236). If consent is refused, the urgent applications judge can authorise the trip once satisfied that it is temporary and that the child's return is guaranteed.

What can I do if the other parent does not respect visiting rights?

You can go to court: it can change the visiting arrangement and, in case of breach or trickery, go as far as removing custody (Articles 183 and 184). If the child is not handed over despite a court decision on custody, this is also an offence punished by Article 477 of the Criminal Code.

Can the non-custodial parent have the child overnight?

As a rule, the child only spends the night with the custodian. The judge may decide otherwise in the child's interest (Article 169). If you want weekends or holidays with overnight stays, have them written into the agreement sent to the court or into the court's decision.

Do grandparents have visiting rights?

Yes, when the child's father or mother has died: that parent's own parents take their place in visiting rights, under the same rules (Article 185).

Official sources

  • Family Code (Law No. 70-03), Articles 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 209 and 236
  • Criminal Code, Article 477

General information, up to date as of the date shown. For a specific situation, ask the assistant or consult a professional.