Mitt Romney was heavily involved in the extremely messy divorce of one of his key supporters … and the Boston Globe is going to court first thing Wednesday morning in an attempt to unseal the court file as well as lift a gag order … TMZ has learned.

The divorce was between Staples co-founder Tom Stemberg and his first wife Maureen. We’re told the divorce battle lasted for years and was extremely ugly.

Sources tell us Romney gave both a deposition in the divorce and testified in the trial. According to our sources, the Boston Globe got a tip that there was “juicy information about Romney” in the sealed documents.