Photo: Courtesy Kamala Harris Photo: Associated Press Photo: Doug Mills / New York Times Photo: Joe Raedle / Getty Images Photo: Saul Loeb, AFP/Getty Images

California Sen. Kamala Harris captured national attention for attacking former Vice President Joe Biden during the second Democratic presidential debate, in part by invoking the racially charged era during which she grew up in Berkeley — a time when the city was a far different place than today’s liberal mecca.

“Berkeley was a majority Republican town into the 1960s,” Natasha Beery, director of community relations for the Berkeley Unified School District, said Friday.

And a segregated one. Most white people lived in the neighborhoods in the northern and eastern parts of the city, and most black people lived in its southern and western flatlands. But the influx of African Americans and others who moved to the East Bay to work in the shipyards and other industries during World War II recast the city and contributed to a progressive coalition that pushed for school desegregation.

Even though Harris’ parents were academics — her Indian-born mother who largely raised her was a cancer researcher, and her Jamaican-born father was a Stanford professor — her family lived west of the city’s racial dividing line, the present-day Martin Luther King Jr. Way, because of redlining policies.

“She lived close to the dividing line,” said Scott Saul, a professor of English at UC Berkeley and editor of “The Berkeley Revolution,” a digital history project. “It is a harbinger of how she has crossed those boundaries throughout her life.”

Harris, who is trailing the front-running Biden in the polls, tapped into that history as she turned the conversation to race halfway through Thursday’s debate. Harris has spent considerable time appealing to black voters in South Carolina, an early primary state, and elsewhere. However, Biden leads all candidates in support among blacks with 39%, according to an Economist/YouGov poll last week of likely Democratic primary voters. Harris had 5% in the same poll.

Harris pointed out that as a senator, Biden worked with segregationists in the 1970s to oppose forced busing to integrate public schools. Biden won election to the Senate in 1972 by supporting integration, but voted for several antibusing amendments in response to pressure from white constituents in Delaware.

“I oppose busing,” Biden said in a 1975 interview. “It’s an asinine concept, the utility of which has never been proven to me.”

The 54-year-old Harris said that “growing up, my sister and I had to deal with the neighbor who told us her parents (said she) couldn’t play with us because she — because we were black.” And she told of being part of “the second class” to integrate Berkeley’s schools and riding the bus every day to do so.

Beery confirmed Friday that Harris was part of the second class to integrate Berkeley’s classrooms when she began school in 1969. The program began the year before.

Conservative critics howled when Harris invoked a similar story to show the power of court decisions during last year’s confirmation hearings of Supreme Court Justice Brett Kavanaugh. Many said Berkeley’s schools had been integrated five years before she started.

But it was Berkeley’s junior high schools that were integrated in 1964, Beery said. Elementary schools didn’t follow suit until 1968, and the city made busing an integral part of the plan. Berkeley only has one high school so it was de facto integrated.

It had its intended effect. Thousand Oaks Elementary School, in a well-off area in North Berkeley near Solano Avenue, was the school to which Harris was bused. It was 95% white and 3% black before the plan was implemented in 1968. The next year, it was 53% white and 40% black, according to the school district.

The Rev. Martin Luther King Jr. wrote in 1967 that his hope of white and black children learning together in the same schools “had grown dim, as had many of my dreams of racial equality.”

But “hope returned to my soul and spirit” when he learned of Berkeley’s program, King wrote in the foreword to the book “Now Is the Time: Integration in the Berkeley Schools,” written by then-district Superintendent Neil Sullivan and published in 1969, the year after King’s assassination.

Not everyone was a fan of the plan. There were efforts to recall school board members who supported desegregation. And some white families moved out of the city.

“It was not a slam dunk,” Beery said. “More affluent and white families didn’t keep their kids in the public schools. And that white flight phenomenon that occurred in other cities happened in Berkeley, too.”

When she was 12, Harris moved from Berkeley because her mother accepted a research job in Canada. She graduated from high school there.

Berkeley still has an integration busing program that “has gone through some evolutions over time,” Beery said.

Lost in the conversation is that busing has long since faded as a means of achieving racial integration. A 1999 Gallup Poll, taken after years of Supreme Court rulings that curtailed mandatory desegregation programs, found that 82% of respondents said “letting students go to their neighborhood schools would be better than achieving racial balance through busing.”

Meanwhile, schools have become more segregated. A report in May by the UCLA Civil Rights Project found that the number of “intensely segregated” schools — those with nonwhite enrollment of more than 90% — more than tripled from 1988 to 2016, to 18.2% of the nation’s total.

Politically, however, Harris’ jab at Biden is paying her early dividends. Sixty-seven percent of likely Democratic voters surveyed in an overnight poll by Morning Consult and FiveThirtyEight rated her favorably, up 10 points from a round of surveys taken shortly before the debate.

Biden’s favorability numbers remained unchanged but his unfavorable rating increased three points, to 19%.

A previous version of this story misstated the initial moves to integrate Berkeley schools. Junior high schools were first integrated in 1964. The story has been altered to reflect this change.

Joe Garofoli is The San Francisco Chronicle’s senior political writer. Email: jgarofoli@sfchronicle.com Twitter: @joegarofoli