San Francisco’s Lowell High School, ranked among the best public schools in the nation, has long admitted high academic achievers to secure its elite status, a practice that has not only led to racial inequities but also could be illegal.

For decades, parents and politicians have debated the school’s selection process, which is largely based on grade-point average and test scores, saying it has created an institution that is both a feather in the city’s cap and an embarrassment in terms of racial equity.

There were 413 Asian American students in Lowell’s class of 2018 and eight African American students.

But only recently have some district officials acknowledged that using grades and test scores to select students could also violate a state law that prohibits the use of academic achievement for admission to regular public schools.

“What I understand is that we probably are in violation,” said Board of Education member Mark Sanchez.

Now Playing:

Board President Hydra Mendoza said she is “unsure” whether Lowell’s admission process violates state law.

The legal question revolves around a section of the state’s education code, which says a selection policy for a high-demand school must have an “unbiased process that prohibits an evaluation of whether a pupil should be enrolled based upon his or her academic or athletic performance.”

The vast majority of students at the school near Lake Merced are admitted based on their grades and state standardized tests or an entrance exam administered by the school.

There are exceptions in the state code for specialized schools, including performing arts schools, but Lowell is a comprehensive high school.

District officials did not answer whether they — or the district’s attorneys — believe the admission policy could be in violation.

Instead, officials said that Lowell has used a competitive admission process since the school’s inception in 1857 and “there is no indication” that the 1993 law applies to its program.

In addition, San Francisco Unified spokeswoman Gentle Blythe said, state officials haven’t told them it’s wrong.

The California Department of Education did not respond to several requests for clarification on whether state officials believe the state code applies to Lowell.

Despite the district’s official response, Sanchez said administrators have raised concerns with the school board about the legality of the admission process for more than a year, but the board has not acted on the information.

“It’s a touchy matter,” he said.

Sanchez has long been a critic of Lowell’s admission policy, saying it leads to “systemic racism.” A former principal at Horace Mann Middle School, Sanchez said that not one of his students was admitted to Lowell in the two years he was there, he said.

On Tuesday, the seven-member school board is expected to amend Lowell’s admission policy, which generally admits students based on a score that takes into account GPA and test results and sets aside a limited number of spots for students from underrepresented schools. The revised policy would lift the cap on the number of qualified students admitted from one of the underrepresented schools, Willie L. Brown Jr. Middle School.

But the changes wouldn’t address the legal question.

Attorney Victor Leung, with the ACLU of Southern California, said that while the civil rights group has not challenged the legality of Lowell’s admission policy based on the specific section of the education code, “we think it perpetuates a two-tier system in education, where some students receive more than others, sometimes at the expense of others.”

Such inequities could lead to a legal challenge, Leung said.

Lowell’s teachers typically have more seniority than other high schools in the district, which means they get paid more, Sanchez said, and there are more Advanced Placement courses, which require the district to pay costs related to additional preparation time.

The selective application process at Lowell has been challenged multiple times in the school’s 162-year history, with the district adjusting its admission policy to accommodate desegregation requirements and challenges when African American and Latino students were admitted with lower test scores than Asian American and white students.

“I resist the notion that some schools should be singled out for super treatment,” NAACP attorney Thomas Atkins said about Lowell in 1995. “It flies in the face of American history and the foundations on which this country was built. This isn’t England. We don’t have a system based on class.”

Yet dumping the entire idea of an academically elite school would set off what Sanchez called a “holy war” in San Francisco, where there is strong and powerful support for Lowell.

Parent Todd David, whose son is a junior at Lowell, is “a huge supporter.”

While he has concerns about the racial disparities, David said he believes families want a school like Lowell that serves a certain kind of child.

“If you are an academically focused kid, you can go there,” he said. “You can be an academic nerd, you can sit in the front row, pay attention, and no one is going to give you a hard time.”

“There has to be a place for these kids,” said Lowell counselor David Beauvais.

Lowell senior Chloe Renner, 17, is one of those kids. But as one of the few dozen black students at the school, she said the strict admission requirements alienate a lot of potential applicants, and that additional pathways would increase diversity.

It is not acceptable for less than 10 percent of a graduating class to be African American, she added.

Her classmate Isabel Olmes-Leiva said she’d also like to see a more “all-around application” to encourage students from a range of backgrounds.

While she believes a competitive admissions process increases the confidence of those who are admitted, diversity would only strengthen the experience that students have at the school after they get in.

Among the school’s 2,700 students enrolled last year, 49 were black, 186 Filipino American, 288 Latino, 481 white and 1,486 Asian American.

Yet John-Lui Valencia, 17, worries that if the academic rigor required for admission is weakened, it would stigmatize some students.

“That’s already a problem for minorities,” he said.

John-Lui, who is of Filipino Samoan descent, said he wants to see more outreach in middle schools to increase diversity.

Lowell is among several public schools across California that use an academically competitive admission policy.

In the Anaheim Union High School District, Oxford Academy, a school for grades seven through 12, uses only test scores to admit students. It is often considered among the best public high schools in the state and in the top 10 nationwide.

The school, however, allocates 25 admission spots to each of the feeder elementary schools.

“We generally feel we’re leveling the playing field as best we can,” said Anaheim Assistant Superintendent Jaron Fried, adding he is unfamiliar with the state code on academic admission policies.

In San Francisco, Sanchez said he believes that “it’s time to do the right thing.”

“If it’s illegal, it’s a black-and-white issue to me,” he said. “If it’s illegal, we should do something.”

The president of the Lowell Alumni Association, John Trasviña, who is also a school board candidate, has a strong opinion on what that action would be.

“The reason why we have Lowell is because the people want it,” he said. “We should fix the (education) code if in fact that is a problem.”

Jill Tucker is a San Francisco Chronicle staff writer. Email: jtucker@sfchronicle.com Twitter: @jilltucker