If the marriage is divorced, annulled, or declared void, both parents continue to be entrusted with custody. However, an agreement may be concluded in court that only one parent is to have sole custody or that the custody of one parent is to be limited to certain matters. An amicable divorce must include an agreement on the custody of the child.