Every school in the city should be engineered to match the exact racial mix of the city, and there should be no sorting by academic ability, an education panel handpicked by Mayor Bill de Blasio and Schools Chancellor Richard Carranza said yesterday.

The panel recommends redrawing school-district lines citywide to “fully integrate” them within 10 years.

Every Gifted & Talented program also should be scrapped, as well as nearly all screening processes — which admit students based on factors such as grades, behavior and attendance — to combat racial and socioeconomic inequality, according to a report issued Tuesday by the School Diversity Advisory Group.

Within three years, every city school should reflect its community in terms of diversity, the report said. In five years, it should reflect its entire borough.

And in 10 years, “every school should be representative of the city as a whole,” the panel said, emphasizing that the city Department of Education “should redraft district lines to support the long-term goal of having all schools reflect the city population,” the group wrote.

According to the US Census Bureau, last year the city’s population was 32% white, 29% Hispanic, 24% black and 14% Asian.

“The city’s new school-choice model allowed families to choose schools they perceived as the best for their children, instead of having them automatically enrolled into their neighborhood middle and high schools,” the panel said. This led the schools to be “highly segregated.”

The report did not say whether the entire choice system should be tossed — or if forced busing might have to be implemented in local districts deemed too racially homogeneous.

Still, the report acknowledged that the controversial moves could spark an exodus of whites and Asians from the system — making the panel’s goal all but impossible.

“If New York City loses students to private schools or families move to other locations, it will become even more difficult to create high-quality integrated schools that serve the interests of all students,” the ­report said.

The panel offered virtually no specifics on ways to avert such a stampede, only calling for “equitable enrichment alternatives” to G&T, which is currently available for kindergarten through fifth grade.

Carranza, flanked by panel members outside DOE headquarters in Manhattan on Tuesday, said, “These recommendations point to a future where every student has access to a rigorous, inspiring, engaging, nurturing education.

“This is not about lowering the bar,” he said. “It is the work that we must do now.”

He refused to take questions.

But the notion of axing G&T programs drew a swift and sharp rebuke from the normally de Blasio-allied head of the city’s biggest teachers union.

“Every community has children who could thrive in a Gifted & Talented program, and it is our responsibility to help our children reach their full potential,” said United Federation of Teachers boss Michael Mulgrew in a statement.

Still, he called for changes to at least one admissions procedure.

“The city should stop using its current admissions test for very young children. This test has always been unreliable and developmentally inappropriate,” said Mulgrew, referring to the fact that kids as young as 4 take a standardized exam for entry into some kindergarten programs.

The mayor only said of the report, “It’s literally a recommendation that just came out. I’m going to assess it.”

But the panel’s stance reflects his and the chancellor’s pervasive agenda of trying to change what they call a racist system.

Hizzoner has the power to implement the group’s findings at nearly all of the city’s schools.

The only exempt schools would be the so-called “Elite Eight” high schools, including Stuyvesant and Bronx Science, which are admissions test-based and under the partial control of Albany.

The recommendations were drawing fire from all corners Tuesday.

City Council Speaker and mayoral hopeful Corey Johnson said he opposes cutting G&T.

“We need to revamp admissions to gifted programs on the district level so that they reflect the diversity of our city’s students. But we must be thoughtful about the process and make sure all stakeholders can weigh in,” Johnson said.

Bronx Borough President Ruben Diaz Jr. added, “The solution to the issues that face our public schools is not to give up on seeking excellence in our students. We should be expanding gifted programs to every community, not eliminating them.”

African American Brooklyn Tech alum Mike Walker, 53, credited his G&T classes with putting him on the path to ­success.

“I don’t think high standards are ever a mistake,” he said.

Last year, 42% of G&T offers went to Asians, 39% to whites, 10% to Hispanics and 8% to African American kids. Meanwhile, the city public school population is about 70% black and Hispanic.

But the City Council’s Education Committee chair, Mark Treyger (D-Brooklyn), said he agrees with the panel’s decision to end what he called the “Bloomberg-era ‘Gifted & Talented’ admissions model,” which requires that students hit at least the 90th-percentile mark on the test.

“This model has failed to live up to its promise of equitable opportunities,” Treyger said.

The panel cited a 2016 article by researchers at The Civil Rights Project at UCLA in comparing New York City schools’ racial breakdown with Mississippi’s and Alabama’s systems.

In Mississippi in May, at least one district still had “largely segregated classrooms — some all black, some majority white,” according to USA Today.