Washington(CNN) President Donald Trump honored civil rights heroes and local officials during remarks at the opening of a civil rights museum in Mississippi on Saturday, staying on message despite recent criticisms of his appearance there.

"We want our country to be a place where every child from every background can grow up free from fear, innocent from hatred, and surrounded by love, opportunity and hope," he said at the opening of the Mississippi Civil Rights Museum. "Today we pay solemn tribute to our heroes of the past and dedicate ourselves to building a future of freedom, of equality and justice and peace."

Trump's remarks were preceded by criticism from civil rights and community leaders, who said Trump shouldn't have attended because of his White House record.

President Donald Trump visits the Civil Rights Museum in Jackson, Mississippi, December 9, 2017.

"He does not deserve to be in Jackson for the celebration of the civil rights museum opening," civil rights activist Amos Brown, a board member of the NAACP, said at a news conference in the city on Saturday. He slammed Trump for "not showing up for our civil rights" both before and during his presidency.

He continued: "We respect your office but ... we do not respect your attitude and your division of the nation."

Trump spoke for about 10 minutes at the opening, thanking state officials for their support of his presidency and praising civil rights activists, including the late Medgar Evers, for their work.

"Their memories are carved in stone as American heroes. That is what Medgar Evers was, he was a great American hero," he said. "That is what others honored in this museum were. True American heroes."

Speakers at a news conference protesting Trump's visit on Saturday hit the President on his White House record, including his efforts to repeal Obamacare and enact a travel ban, saying his moves contradict the work of the civil rights movement.

Myrlie Evers, the widow of Medgar Evers, said at the ribbon-cutting ceremony that she was filled with pride in seeing the completed museum, as well as the new Museum of Mississippi History, which opened alongside it. Evers added that she wept when she toured the space. She did not mention Trump's appearance.

"I felt the blows, I felt the bullets, I felt the tears," she said. "I felt the cries but I also sensed the hoped that dwelled in the hearts of all of those people and those children."

"Lead the way, not only for those of us here but throughout America, because today we are being challenged almost as much as we were when Medgar Evers was alive," she added.

Earlier this week, Mississippi Democratic Rep. Bennie Thompson and Georgia Democratic Rep. John Lewis, who were both involved in the civil rights movement, slammed Trump for his attendance at the event.

"President Trump's attendance and his hurtful policies are an insult to the people portrayed in this civil rights museum," they said in a joint statement.

White House press secretary Sarah Sanders responded to their statement Thursday, calling their remarks "unfortunate."

"We think it's unfortunate that these members of Congress wouldn't join the President in honoring the incredible sacrifice civil rights leaders made to right the injustices in our history," Sanders said Thursday. "The President hopes others will join him in recognizing that the movement was about removing barriers and unifying Americans of all backgrounds."

On Friday night, Trump held a rally in Pensacola, Florida, where he spoke just days ahead of the special election in Alabama, after having put his full support behind controversial Republican Senate candidate Roy Moore earlier this week.

Moore recently praised the era of US history that included slavery because, according to Moore, families were stronger. Moore is facing accusations that he pursued relationships with teenagers, molested a 14-year-old, and sexually assaulted a 16-year-old when he was in his 30s. He has repeatedly denied the allegations.