The bitter divorce between the once-powerful United Neighborhood Organization and the vast, government-funded charter-school network it created has been settled — at a cost to taxpayers of $4.5 million, according to records obtained by the Chicago Sun-Times.

The sticking point in the long-running dispute between UNO and the UNO Charter School Network, known as UCSN, had been what would happen to four school buildings the Hispanic community organization built with $83 million in state funding pushed through Springfield by Illinois House Speaker Michael Madigan, D-Chicago.

Under the deal to finalize the split, UNO turned over ownership of the four properties to the charter-school network, which operates six schools in those buildings.

The $4.5 million breaks down like this: UCSN pays $2.5 million in management fees UNO said it was owed for running the schools, plus a $2 million “settlement payment” to the community group, records show.

The private, not-for-profit charter network operates 15 campuses across the city. The schools depend almost entirely on taxpayer financing through the Chicago Board of Education for their yearly budget of nearly $100 million.

In a joint statement, UNO and UCSN officials said the deal was “in the best interest of the students and families of the UNO Charter School Network and its surrounding communities.” The agreement includes a three-year “non-disparagement” clause, with UNO and UCSN officials agreeing not to discuss the deal beyond their statement.

UNO founded the charter-school chain in 1998, and it grew rapidly with the aid of powerful allies, including Madigan, who sponsored a 2009 law setting aside $98 million in state grant money for UNO to build schools.

For years, the organization and its charter network both operated under the leadership of Juan Rangel, UNO’s clout-heavy chief executive officer, and had common board members. The charter group paid UNO millions of dollars a year to manage the schools and also paid rent for the buildings.

Rangel resigned under pressure from his $275,000-a-year job after the Sun-Times reported in 2013 that UNO insiders profited from the state grant. The two organizations formed separate boards, and the new charter board moved to cut ties with UNO, dropping the lucrative management deal that was the community group’s main source of cash.

Last year, UNO’s new leaders said the group was “on the brink of insolvency” and that the four state-funded school buildings might end up sold in bankruptcy, putting thousands of children out of their classrooms.

The buildings house Roberto Clemente charter in Galewood, the Soccer Academy elementary and high schools in Gage Park and three schools at the Veterans Memorial Campus in Archer Heights.

“With more than 4,000 students currently enrolled in these six schools, the sale ensures that the buildings will remain as schools and not be sold for other purposes,” UNO and UCSN officials said in their statement.

UNO began more than 30 years ago on the Southeast Side. It became a force in politics, with Rangel forging alliances with powerful government figures and moving the group into the lucrative field of privately run, publicly funded charter schools.

Beyond the state funding, the schools UNO built have gotten hundreds of millions of dollars in operating funds through the Chicago Public Schools system.

Dignitaries would flock to ribbon-cuttings for the gleaming new schools. During Mayor Rahm Emanuel’s first run for mayor, Rangel co-chaired his campaign.

But politicians distanced themselves from Rangel and UNO, and state officials withheld the final $15 million of their $98 million grant after the Sun-Times reported UNO had paid millions out of the state funding to construction companies owned by brothers of Rangel’s top deputy, Miguel d’Escoto.

That led to a June 2014 civil settlement in which the U.S. Securities and Exchange Commission accused UNO of defrauding bond investors by “making materially misleading statements” about the construction contracts. Rangel later agreed to pay a $10,000 fine.

Until the scandal, the finances of UNO and the charter schools were intertwined. Under the new settlement, the community group no longer is responsible for repaying more than $70 million borrowed by the charter schools, and UCSN released UNO from responsibility for $31 million it had lent the organization.

While operating the schools, which serve largely Hispanic students in low-income neighborhoods, UNO spent lavishly, the Sun-Times reported in March. It charged more than $60,000 for restaurants on Rangel’s American Express “business platinum” card in one year and spent more than $60,000 a year  on travel in 2010 and 2011. Records show Rangel flew out of town 31 times in four years at the group’s expense.