Last July, 34,000 middle school students filled their summer days at camps funded by the city’s Department of Youth and Community Development. In Brownsville, a program run by Partnership With Children offered children three days each week of sports and arts activities and two days of field trips to places like museums, baseball games and Coney Island.

But this year, the organization is scrambling to put on a camp they didn’t expect to run, since their funding was in jeopardy until mid-June.

“We’re pleased that the city decided to fund this program, but it’s very, very challenging to put a high-quality program in action with very little notice,” said Rachel Cytron, chief operating officer at Partnership with Children. “It’s hard to keep staff and parents and kids in limbo when they’re asking if there will be camp this summer.”

The camps are part of a broader after-school program called School’s Out New York City (SONYC), which started in 2014 and was extended to the summer last year. But throughout this spring, the city maintained its stance that it would not be able to fund summer programming run by the SONYC providers, all of whom provide after-school services during the school year.

Then, in a last-minute turnaround, the mayor included an extra $17.6 million for the summer program into his executive budget last month, leaving providers just under six weeks to put together roughly a month of programming. The camps must begin on or before July 29.

SONYC providers were notified of the funding’s restoration by email on June 15, and given until June 20 to respond to a survey indicating whether they were able to run a summer program and how many seats they could fill. The funding will support up to 26,000 seats, a 24 percent decrease from last year.

Push and pull over the funding for the summer program is not new — last year, the city redirected SONYC’s summer money to struggling schools in early May, leaving providers in limbo. Under pressure from advocates, the city restored the funding by the end of the month, but warned that the restoration was a one-time deal.

This year, advocates called for another round of summer funding, even as the city insisted it wouldn’t happen. In March, the advocacy group Campaign for Children released a report that showed the neighborhoods that would lose the most slots from the funding cut have childhood poverty rates that far exceed the city’s 30 percent average.

“Low-income kids who don’t get summer programming fall behind their peers,” said Stephanie Gendell, an associate executive director at the Citizens Committee for Children of New York, which produced the report. “This program also literally keeps kids off the street. Without it, a lot of them would probably be stuck at home.”

The uncertainty and resulting time crunch have left programs operating under capacity. With no guarantee that programs would be funded, a number of providers said that staff members left to seek other employment for the summer. Families also had to look for other options under the assumption that programs would not happen.

And programs that borrow space in schools or other sites face additional hurdles. Laura Timme, an associate executive director at University Settlements, said the individual locations need special licenses to serve children over the summer, a process that “does not happen overnight.” New employees cannot work immediately, Timme said, as they must first have their fingerprints checked by both the Department of Health and the Department of Education.

Providers were allowed to request funding for up to the number of seats they serve in their regular after-school programs. This year, Partnership With Children served 180 students at two separate sites, but only requested 60 seats at one site for the summer, Cytron said, citing the short turnaround time for the reduced capacity.

Timme also said that University Settlements could not run programs at all their sites. Instead, the newly funded seats will be rolled into programs that were already scheduled to run this summer.

“We’re trying to take as many as we can, but if we had known in May, ideally in the first half of May, then we would have been able to operate in all of our locations,” she said. “We could have told families, so they had enough time to plan, and kept our staff instead of having to lose them and rehire each year.”

Those who were anticipating a last-minute save are somewhat better off. Sports and Arts in Schools Foundation will run programs at 43 sites this summer for 3,432 middle school students. Chief executive officer James O’Neill said the organization had been prepared to heavily recruit staff and students as soon as summer funding was confirmed.

“The history of a lot of summer programs is late notice,” he said. “I told staff we couldn’t guarantee it, but there was a good chance it would come through.”

Though SONYC providers prevailed this year, the city has warned that funding for next summer is still up in the air, a fact that frustrates advocates.

“We really believe that this program is critical for children,” Gendell said. “We’re hopeful we don’t have to do the budget advocacy dance again.”