Where did the word exas in ex husband originate?

The prefix 'ex' - indicates something that used to be , but is no longer. For example - ex-husband, ex-addict, ex-patriot.