Students in New York City’s public elementary schools will be served breakfast in their classrooms starting in the fall, as part of the $78.5 billion budget deal announced this week by Mayor Bill de Blasio and the City Council speaker, Melissa Mark-Viverito.

Public schools have offered free breakfast to all students for more than 10 years, but to take advantage of that program in many schools, children must arrive early and head to the cafeteria. Josh Wachs, chief strategy officer for Share Our Strength, an anti-hunger organization, said this created logistical problems for families and stigma for students, which has translated into one of the lowest participation rates among poor children of any major city.

Under the new program, which will begin this fall and ramp up over three years, a breakfast of protein, a grain, fruit and milk will be served in most elementary school classrooms.

Some schools already offer breakfast in the classroom, but Mayor Michael R. Bloomberg’s administration opposed expanding the program, saying that some children might eat breakfast twice, at home and at school, worsening the city’s obesity problem. But the de Blasio administration did not share that view. “We know that for children to learn in school, they need to be well nourished and this is why we are so focused on meeting the whole needs of children,” said Devora Kaye, a spokeswoman for the Education Department.