Casting the disaster that befell New Orleans a decade ago as a failure of government not just to protect its people but also to deal with problems of inequality, racism and a lack of housing and health care, a visiting President Barack Obama on Thursday painted the region’s recovery as a source of inspiration and pride, as well as an ongoing struggle.

While acknowledging continuing problems with violence, inequality, poverty and unemployment in the city, Obama also held up New Orleans as an inspiration for the rest of the country in the way it has handled the aftermath of Hurricane Katrina and a model of innovation in public institutions.

“The people of New Orleans didn’t just inspire me; you inspired all of America,” Obama told a crowd of several hundred at the recently completed Andrew P. Sanchez Community Center in the Lower 9th Ward. “Folks have been watching what’s happened here, and they’ve seen a reflection of the very best of the American spirit.”

Obama’s half-hour speech echoed themes that Mayor Mitch Landrieu and his administration have stressed in the run-up to Saturday’s 10th anniversary of Katrina: the desire to rebuild New Orleans not as it was “but as it should be” and a focus on “resiliency,” a term variously deployed to describe the people of New Orleans, improvements made to the levees and floodwalls and changes to city government aimed at making the city better capable of handling a future disaster.

The speech touched on individual stories of struggle in the aftermath of the storm, as well as successes, such as students working toward jobs in the technology sector. And Obama highlighted the efforts his administration has made toward the city’s recovery.

“If Katrina was initially an example of what happens when government fails, the recovery has been an example of what’s possible when government works together — state and local and community — everybody working together as true partners,” Obama said.

The trip was Obama’s ninth to New Orleans since taking office, including a similar commemoration at Xavier University on the fifth anniversary of Katrina.

While much of the discussion of the recovery has focused on the physical rebuilding of New Orleans — including about $71 billion in federal money — Obama also focused on institutional issues that allow inequality to remain, praising New Orleans as a city that is experimenting with new ways of doing things and specifically praising the changes to the city’s school system.

“As hard as rebuilding levees is, as hard as rebuilding housing is, real change — real lasting, structural change — that’s even harder,” he said. “And it takes courage to experiment with new ideas and change the old ways of doing things.”

Obama did not dwell on the failure of the federal levee system in his remarks, discussing instead the failure of government institutions to properly deal with deeper, structural problems in the city that left residents ill-prepared for the disaster.

“The storm laid bare a deeper tragedy that had been brewing for decades because we came to understand that New Orleans, like so many cities and communities across the country, had for too long been plagued by structural inequalities that left too many people, especially poor people, especially people of color, without good jobs or affordable health care or decent housing,” Obama said.

“Too many kids grew up surrounded by violent crime, cycling through substandard schools where few had a shot to break out of poverty. And so like a body weakened already, undernourished already, when the storm hit, there was no resources to fall back on.”

Many of those issues still plague the city, something local officials and Obama have both acknowledged.

“Our work here won’t be done when almost 40 percent of children still live in poverty in this city,” Obama said. “That’s not a finished job. That’s not a full recovery. Our work won’t be done when a typical black household earns half the income of white households in this city. The work is not done yet.”

A pledge for a recovery that benefits the city as a whole was included in Landrieu’s introductory remarks.

“No matter how much progress we’ve made, the city of New Orleans has not gone forward unless we go forward together,” the mayor said.

Obama will be followed to town by two of his predecessors.

Former President George W. Bush, who earned scorn from many New Orleanians for his administration’s response to the disaster, will hold an education-focused event Friday morning at Warren Easton Charter High School. Then, former President Bill Clinton will take the stage with Landrieu on Saturday evening at the Smoothie King Center for the city’s official commemoration of the 10th anniversary.

After arriving in the area just after noon Wednesday, Obama’s motorcade headed to Faubourg Lafitte, the mixed-income neighborhood built to replace the former Lafitte public housing complex.

While walking the streets and greeting residents on their porches, at one point cradling a 6-month-old baby, Obama asked about the people who had moved back and the way the development is working out.

He also admired the architecture of the new detached houses designed to blend in with older neighborhoods.

“It looks like New Orleans,” he said.

The president then headed for lunch at Willie Mae’s Scotch House with Landrieu and other officials before continuing on to the Sanchez Center.

His speech was full of New Orleans references and, in many cases, clichés. He suggested still-displaced residents “live the words sung by Louis Armstrong: ‘Do you know what it means to miss New Orleans?’ ”

He referred to the city as a gumbo and a place where “the jazz makes you cry and the funerals make you dance.”

He gave shout-outs to restaurateur Leah Chase, whom he spoke with earlier in Treme, and a member of the Marsalis family.

And he promised that, after he leaves office, he’ll come down to hear the Rebirth Brass Band at the Maple Leaf and, paraphrasing Dr. John, “see the Mardi Gras and somebody will tell me what’s Carnival for.”

“But for right now, I just go to meetings,” Obama said.

Gov. Bobby Jindal greeted Obama when Air Force One arrived at Louis Armstrong International Airport but was not on hand during the rest of the president’s visit.

On Wednesday, Jindal blasted Obama after media reports cast the trip to New Orleans as part of a presidential tour to warn about the dangers of climate change. He called on Obama not to “politicize” the Katrina commemorations by bringing the topic up.

Climate change and the threat that rising sea levels pose to the city ended up rating only a passing mention in Obama’s speech, with a few sentences pointing to the new levees built by the U.S. Army Corps of Engineers after Katrina and the federal government’s investments in wetland restoration.

That likely chagrined those who have argued the Obama administration should be doing more to restore and protect eroding coastal areas.

In introductory remarks, former Mayor Marc Morial said the Lower 9th Ward represents “the deepest hopes, the great passions, the great talents that this city has contributed to the world.”

“This is sacred ground,” Morial said. “This is ground that the waters may have flooded and may have washed, but this is ground that will rise again.”

And U.S. Rep. Cedric Richmond, D-New Orleans, praised the Obama administration’s assistance to the city and state, despite Louisiana’s deep Republican streak.

“This president has been better to the state of Louisiana than this state has been to him,” Richmond said.

Follow Jeff Adelson on Twitter, @jadelson.