But in Richmond, the decision to remove the name of James Ewell Brown Stuart, a cavalry general, and replace it with Mr. Obama’s has poignant resonance.

A city of 223,000 people, Richmond was the former capital of the Confederacy, and its streets, public plaques, and monuments reflect the history of the period. A city commission is expected this year to present recommendations about what to do with monuments to such figures as Jefferson Davis or Gen. Robert E. Lee, Mayor Levar Stoney said Tuesday.

He said the school was the only one in the city named after a Confederate figure, and that the move to rename it reflected the progressiveness and diversity of the city, which is 48 percent black.

“Richmond has always been front and center in the growth of the South,” he said.

Mayor Stoney said that the vote corrected a “serious contradiction” in having students, mostly of color, attend a school named after a figure who fought to preserve slavery.

The process took several months.

Teachers, parents and community members were invited to attend public meetings and submit online suggestions. Student assemblies were held. Seven options were eventually drawn up, including Wishtree, named after a children’s book that celebrates diversity; Northside, reflecting the neighborhood; Barbara Johns, a civil rights activist; and Henry Marsh, the city’s first African-American mayor.

In the end, the students themselves were asked to pick three choices, which whittled the list down to Wishtree, Northside and Barack Obama. The school board made the final pick, reflecting the recommendation of Mr. Kamras, who served as the education adviser for Mr. Obama’s campaign in 2008.

He said the city would consider whether other schools should be renamed as well.

Kenya Gibson, the sole school board member who voted against the renaming, said she had wanted more time to discuss the possibility of naming the school after a local civil rights leader. But she still supported the result.