Steve Levitan's bitter divorce has come to an end, and his ex-wife is walking away with a huge amount of money ... but so is he.
According to new legal docs obtained by TMZ ... Krista Levitan will get at least $4 MILLION a year in income from various projects -- including "Modern Family" -- but as long as that cash keeps flowing in ... he won't have to pay any spousal support.
But, that's not all -- Krista and Steve are also splitting several bank accounts worth tens of millions of dollars ... along with going 50/50 on various properties and cars.
Specifically, the docs say the 2 are to split the profits from the sale of their Santa Monica home ... which is worth about $40 million.
We broke the story ... Krista filed for divorce from Steve in 2016 after 23 years of marriage, and it appeared there was no prenup.
Things later took a nasty turn when Krista made claims of assault against Steve and tried to get a restraining order. A judge shot it down, but the divorce battle raged on.
It's all over now, though ... and both Steve and Krista have a lot of cash to remember each other by.