BEDFORD, N.Y. -- The two sides of Mary Richardson Kennedy’s grieving family faced off in court Friday, just hours before a planned wake for Robert F. Kennedy Jr.’s estranged wife, as a relative described a long fight with psychiatric illness that ended in suicide.

Details of the legal dispute were sealed by a judge, but it came as the Kennedy and Richardson families were finalizing arrangements for separate memorial services for the 52-year-old architect and environmentalist, who committed suicide Wednesday by hanging herself. Mary and Robert Kennedy had been going through a lengthy, contested divorce.

Robert Kennedy declined to speak about the matter after emerging from a closed court session in White Plains on Friday afternoon, saying only, “It’s all done.” Lawyers for Mary Kennedy’s siblings also declined to comment or didn’t return phone calls.

After the legal proceedings concluded, the medical examiner’s office in Westchester County received an order instructing them to release the body to a funeral home in Bedford, according to a county spokeswoman.

Mary had been close with the Kennedy family for decades, dating back to a childhood friendship with one of Robert’s sisters, Kerry Kennedy.

One of Mary’s brothers, Thomas Richardson, filed a legal motion in White Plains on Thursday listing Robert Kennedy as the defendant. The document wasn’t made public and was then subsequently sealed, along with all other papers related to the case, by Judge Joan Lefkowitz.

The court filing came on the same day that the Kennedys had announced their memorial plans for Mary, which included a wake at the couple’s home in Bedford on Friday evening, a funeral Saturday morning at a Roman Catholic Church, and burial later in the day near the family’s seaside compound in Hyannisport, Mass.

Meanwhile, Mary Kennedy’s siblings announced through their lawyer, Kerry Lawrence, that they were planning a memorial service in Manhattan, though they didn’t say when.

Lawrence declined to answer questions about the court filing Friday. The lawyer listed in court records as representing Thomas Richardson, Patricia Hennessey, had also served as Mary’s divorce lawyer. Hennessey did not return a phone message.

Mary Kennedy hanged herself at the family’s Bedford estate after struggling for years with depression and alcohol.

“She struggled so hard, for so long, with mental illness, which so many Americans suffer with,” Kerry Kennedy said in brief remarks to reporters outside the church where the funeral was planned. “She fought with dignity, and in the end, the demons won.”

Mary and Robert, the son of assassinated U.S. senator and Attorney General Robert Kennedy, had been in divorce proceedings since 2010. The couple had been living in separate homes and had four children together.

Records in the couple’s divorce case are sealed, but the public docket sheet showed that Robert Kennedy’s lawyers had sought a contempt order in the case last summer, indicating a dispute between the two sides.

American Express also sued Mary Kennedy in April, claiming she owed $32,624 in unpaid bills. Her lawyers didn’t respond to inquiries about that lawsuit.

——— Caruso reported from New York.