Nikki Haley, the Republican presidential candidate and former governor of South Carolina who for years has wrestled with how to approach issues of race, slavery and the Confederacy, found herself again confronted with those subjects at a town hall event on Wednesday in New Hampshire, hundreds of miles north of the Mason-Dixon line.

Her answer to a simple yet loaded question by an audience member in the city of Berlin — “What was the cause of the United States Civil War?” — showed just how much she continues to struggle with such topics.

“I mean, I think it always comes down to the role of government and what the rights of the people are,” she said eventually, arguing that government should not tell people how to live their lives or “what you can and can’t do.”

“I will always stand by the fact that I think government was intended to secure the rights and freedoms of the people,” she said. “It was never meant to be all things to all people.”

Notably missing from her answer was slavery, which most mainstream historians agree was at the root of the United States’ bloodiest conflict — specifically the economics and political control behind slavery. Democrats were quick to jump on her answer, with President Biden’s re-election campaign team and others spreading video of the exchange on social media.

After a quick back and forth with the questioner, she said, “What do you want me to say about slavery? Next question.”

“I am disgusted, but I’m not surprised — this is what Black South Carolinians have come to expect from Nikki Haley, and now the rest of the country is getting to see her for who she is,” Jaime Harrison, chairman of the Democratic National Committee, said in a statement.

How much it matters, if at all, in the Republican primary race is yet to be seen. Former President Donald J. Trump, the front-runner in the race, has been ramping up the temperature on his own divisive rhetoric, not lowering it. Ms. Haley is looking to tap into some of his supporters. But as she looks to New Hampshire’s first-in-the-nation primary on Jan. 23, she is counting on moderate Republicans and independents — who may vote in the contest — to give her a strong showing.

Her latest remarks were in keeping with the way she and most of her Republican rivals have toed the line on race and racism on the 2024 presidential trail, downplaying the nation’s sordid racial history and portraying structural racism and prejudice as challenges of the past. The remarks also are in line with her campaign message, which has included pledges to reduce the size of the federal government and leave it up to the states to decide how to handle major issues like abortion.

A Haley spokeswoman did not immediately respond to a request for a comment on Wednesday night.

Ms. Haley, who governed a state at the heart of the Confederacy, has a particularly complicated record on issues of race.

She drew national acclaim when she signed legislation to take down the Confederate battle flag at the South Carolina State House, after a white supremacist shot and killed nine Black parishioners in Charleston in 2015, including a state senator. On the trail, she recalls the experience to significant effect, casting herself as a new generational leader in the Republican Party capable of bridging differences.

But as she ran for election in 2010 and then re-election in 2014, she rejected talk of removing the flag. In a 2010 interview with Confederate heritage group leaders, a major political force in her state, she argued that the Confederate flag was “not something racist” but about tradition and heritage. She said that she could leverage her identity as a minority woman to fend off calls to boycott the flag. “You know for those groups that come in and say they have issues with the Confederate flag, I will work to talk to them about it,” she said.

After the 2015 attack shook South Carolina, Ms. Haley seized on efforts from state lawmakers to remove the flag.

In response to the audience member on Wednesday, Ms. Haley argued that the United States needed to have capitalism and economic freedom and to ensure “freedom of speech, freedom of religion, freedom to do or be anything they want to be without government getting in the way.”

The audience member said it was “astonishing” that Ms. Haley had answered his question without saying the word slavery.