Getty Composite

Shannen Doherty Settled Ugly Divorce with Husband ... Shortly Before She Died

Shannen Doherty was in the middle of an ugly divorce with her husband before she died -- but it looks like it was a chapter they were able to close together, on the same page.

New legal docs, obtained by TMZ, show that the late actress and her estranged spouse, Kurt Iswarienko, reached an agreement on a number of issues in their divorce case ... which was very much so active before Shannen passed away this weekend.

In the paperwork, it notes both parties had come to terms on property and other issues ... and that the case would not proceed as uncontested. As part of their settlement, they also served docs with final disclosures that usually cover finances and such.

What's also interesting is that in the docs, Shannen says she waives her right to receive future spousal support -- but it's unclear what was covered in the actual settlement, such as a lump sum amount that might have resolved the issue without ongoing payments.

ICYMI ... Shannen had recently requested upwards of $15k/month in spousal support from Kirk -- and not just that, but she was also seeking thousands in attorneys' fees and more.

She'd noted in recent legal filings that her "Charmed" residuals and other money she makes from her past TV work was drying up -- hence her running to court to ask a judge to force Kurt to fork over more dough.

The agreement between her and Kurt came just a day before she died from cancer. The terms of their settlement haven't been made public yet.

Click here for info about our online advertising practices.