New summer school enrollment numbers show a continuing decline in the percentage of New York City students in grades 3-8 mandated to attend summer school.

The city is projecting that for 2017, 16,577 students will be mandated to attend summer school, or 5.4 percent of all students. That number represents a decline from last year, when 17,840 elementary and middle school students — or 6 percent — were mandated to attend, and it continues a four-year downward trend. In 2014, about 32,200 students were assigned to summer classes, or roughly 10 percent.

Under former Mayor Michael Bloomberg, summer school was part of a push to curb “social promotion” by not allowing students who scored poorly on state tests to go on to the next grade. But Mayor Bill de Blasio and schools Chancellor Carmen Fariña announced a policy shift in 2014, based on state law, designed to decrease the weight given to students’ test scores and offer schools more of a say in which students were held back.

Summer in the City, which begins on July 5, provides both mandated and optional summer learning programs for students, including STEM-based lessons and visits to New York City cultural institutions. Last year, after a major overhaul spearheaded by Fariña, the program served 160,316 students, a 5.5 percent increase in student enrollment over the year before.

The department also announced that this year, the city’s summer learning programs will run for six hours a day, a 50 percent increase from the four-hour days in years past.

According to the city’s education department, the city is spending $86 million dollars on the program, an increase of $20 million over last year’s budget. The city will also increase the number of seats for second-graders struggling in reading and math.

“Our high-quality Summer in the City programming – including two additional instructional hours each day – will support our students and ensure they are on track to succeed next school year,” Fariña said in a statement.