Mayor Bill de Blasio made an unexpected appearance at a meeting of charter school leaders and Department of Education officials today, presenting himself as enthusiastic about charter schools on a day when he has been attacked from both sides for his positions on co-locations.

The charter school operators, who represent a coalition that aims to collaborate with de Blasio, were expecting to meet with Ursulina Ramirez, Chancellor Carmen Fariña’s chief of staff, and other officials from City Hall today for a second conversation about how the charter sector and City Hall can work together. (Fariña was at the first meeting, two weeks ago, but not at today’s.)

Instead, the mayor himself spent 45 minutes talking through policies related to charter schools and other issues, according to several coalition members who attended. The meeting came just hours after de Blasio conceded on national television that his administration “could have done better public relations” around charter schools.

The biggest news, the charter operators said, was that de Blasio said he would allow new space-sharing plans in the future in conjunction with a new decision-making process, potentially allowing the charter sector to expand in public space.

“That’s new — we were very concerned that there would be no growth,” said one charter operator who requested anonymity because he was not designated to speak for the group.

De Blasio also signaled that he would work with charter schools to make sure they are included in two of his lobbying priorities: expanding pre-kindergarten programs and increasing state aid to city schools.

Currently, state law prohibits charter schools from operating pre-K programs. When de Blasio offered, as he has before, that charter schools can offer pre-K through associated nonprofits, the charter operators explained that the arrangement would be problematic because pre-K students would not be guaranteed kindergarten admission.

“He immediately came back and said he was really interested in digging into that as an issue,” said Rafiq Kalim Id-Din, who runs Teaching Firms of America Charter School. “He expressed a full-throated desire and commitment to see charters as a partner in that work.”

The meeting did not delve deeply into more specific policy issues, such as enrollment or de Blasio’s plan to charge rent to some charter schools.

But de Blasio indicated that when he would consult with charter school leaders when hashing out future policies involving charter schools, the operators said, and Rich Buery, a deputy mayor who used to run a charter school when he headed the Children’s Aid Society, committed to regular meetings with the group.

And City Hall officials signaled that they are interested in working only with charter operators who are committed to collaborating with the de Blasio administration.

“They were also clear that they want to be talking to people who aren’t shooting at them at the same time,” said one operator, alluding to the litigation against the city that Success Academy CEO Eva Moskowitz filed today over de Blasio’s changes to co-location plans for her schools.

By far, the most promising sign was that de Blasio himself engaged in the conversation, said Stacey Gauthier, who runs Renaissance Charter School in Queens.

“We were surprised that he came in, and happy to be reassured that he wants to work with us,” she said.