Maryland Family Law Section 11-112
§ 11-112.
  When granting a limited divorce, an absolute divorce, or an annulment, if the court finds from the testimony of 2 or more physicians competent in psychiatry that 1 of the parties is permanently and incurably insane with no hope of recovery, then, notwithstanding any agreement between the parties, the court may require a party to:
    (1)   pay alimony or support for the benefit of the insane party;
    (2)   pay a lump sum, based on the life expectancy of the insane party and the financial condition of the other party, together with the insane party's reasonable funeral expenses; or
    (3)   give bond to this State conditioned on the payment for:
      (i)   the care and support of the insane party for the rest of the insane party's life; and
      (ii)   the insane party's reasonable funeral expenses.