One way the city is trying to enroll more black and Hispanic students at its elite specialized high schools is by expanding a program for students who scored just below the cutoff on the entrance exam. But that program actually is helping more white and Asian students get into those schools — illustrating the challenge of boosting black and Hispanic enrollment at those most-competitive schools.

The city will expand the Discovery program, which extends admission to some students who score just below the admissions cutoff and who complete summer coursework. Officials announced the expansion as part of a larger push to increase diversity in the specialized high schools on Thursday. The existing Discovery program at Brooklyn Technical School will expand, and a new program will begin at the High School of American Studies at Lehman College, the smallest of the eight schools.

Most of the students in the Discovery program, though, are not black or Hispanic. And as enrollment for summer 2016 grows — to 220 students from 120 last summer — its share of black and Hispanic students is declining. In addition, two of the top specialized schools simply choose not to participate in the program.

In 2015, just over 32 percent of students in the Discovery program were black or Hispanic. That percentage is shrinking to just over 26 percent this summer, though that represents 20 more students than last year.

Citywide, nearly 70 percent of high school students are black or Hispanic. At the eight specialized high schools next year, that number will be just 10 percent — a number that Mayor Bill de Blasio and Schools Chancellor Carmen Fariña have long said is concerning.

Department officials said that last summer, five schools offered 120 seats through the Discovery program: Brooklyn Latin, Brooklyn Tech, Staten Island Tech, Queens High School for the Sciences, and the High School for Math, Science and Engineering. Years ago, Stuyvesant and Bronx Science also participated in the Discovery program. Asked why all the schools don’t participate, city officials said state law allows schools to opt in.

A department spokeswoman said both Brooklyn Tech and American Studies are increasing the size of their incoming class to accommodate new students from the Discovery program.

New York City will spend $15 million over the next several years on several other programs meant to boost diversity at these eight schools.

This fall, the city will also administer the admissions test on a school day in five middle schools, which they said will be schools that have a large number of “high-potential students” from underrepresented communities. The Specialized High Schools Institute, or DREAM Program, will run a version this summer open to up to 500 eighth graders. The current program enrolls sixth and seventh-grade students in a 22-month curriculum to prepare for the admissions test.

In addition to DREAM, the city will partner with middle school after-school programs to offer test preparation, and dedicated outreach teams will work to increase the number of students who register for the exam.

Another initiative is aimed at increasing the number of black and Hispanic students who accept their offers at the schools once they receive an offer. This year, 77 percent of black and Hispanic students accepted their offer, compared to 86 percent of Asian students. All eight schools will be required to develop a plan for creating “a welcoming climate” for all students.

“Our specialized high schools need to better reflect the diversity of our neighborhoods and our City while maintaining their high standards,” Mayor Bill de Blasio said in a statement, “and this strong package of reforms is an important step forward.”