Mayor de Blasio called for a truce Sunday in the bitter charter-school war, urging an end to “divisive rhetoric,” and taking the blame for getting out the wrong message.

After months of blasting charter schools, he went to Manhattan’s Riverside Church and pledged to work with them, saying, “I won’t choose between our children in this city any more than any parent can choose between children of their family.”

The mayor struck a conciliatory tone — and even promised to find new buildings for students at Success Academy, run by his archenemy Eva Moskowitz. The mayor had barred three of the academies from locating in public schools.

“They are all our children; they all deserve a solution,” he said Sunday. “I will reach out to all of the children, in traditional public schools, in charter schools, in religious schools.”

He took the blame for the charter-school turmoil that is now echoing up to Albany.

“We made some decisions in the last weeks . . . But I have to tell you I didn’t measure up when it came to explaining those decisions. So let me start to right the ship now.”

De Blasio also conceded that charter operators and their non-unionized educators care about kids as much as do his supporters among public-school teachers and their unions.

“I know people of every ideology who want to shake the foundations,” de Blasio said. “I know teachers in traditional public schools who want to shake the foundations. I know people in the charter-school movement who want to shake the foundations. And what can unify us is that sense of urgency that we can’t accept this status quo.”

De Blasio’s boldest pronouncement was a commitment to make sure that the students at Moskowitz’s charter Success Academy Harlem Central Middle School school find a home.

“There’s a charter school with 194 children,” de Blasio said. “It’s a good school doing good work, and we are going to make sure those 194 children have a good home this year. But we will not do it at the expense of our special-education children.”

The academy filed a federal civil-rights suit earlier this month, opposing de Blasio’s decision to boot the school.

Despite the olive branch, not everyone was convinced that de Blasio really wanted classroom détente, especially since he never mentioned a change in policy on such issues as charging charters rent in city property.

Also, some of his closest allies are still against charters, such as Council Speaker Melissa Mark-Viverito, who is pressing ahead with a lawsuit trying to force charters from dozens of schools.

“It’s just another campaign speech,” said a prominent charter-school official.

“Rhetorically, it was more conciliatory toward charter schools. There was recognition of the good work charter schools are doing. But the proof is in the pudding. He has not backed off his anti-charter school positions — blocking co-locations, eliminating construction funding, and charging charter schools rent.”

James Merriman, CEO of the New York City Charter School Center, hoped the speech indicates a change of heart by de Blasio.

“We will work with him shoulder-to-shoulder to make his vision a reality,” Merriman said. “In turn, we are hopeful that he will work with the governor and state Senate to convince the Assembly, not just to make pre-K and increased after-school programming a reality, but also to provide the charter sector, for the first time, with equitable funding.”

As for Gov. Cuomo,, with whom de Blasio has clashed on charters and pre-K funding, the mayor sought to bury the hatchet.

“I know Gov. Cuomo wants us to have pre-K for all of our children, and I honor him for that,” de Blasio said.