WASHINGTON — President Obama toured the storm-tossed boardwalks of New Jersey’s ravaged coastline on Wednesday, in a vivid display of big-government muscle and bipartisan harmony that confronted Mitt Romney with a vexing challenge just as he returned to the campaign trail in Florida.

The scene of Mr. Obama greeting his onetime political antagonist Gov. Chris Christie in Atlantic City was a striking departure from what has become an increasingly bitter campaign, marked by sharp divisions between Mr. Romney’s more limited view of the federal role and Mr. Obama’s more expansive vision. The president placed a hand on Mr. Christie’s back and guided him to Marine One, where the two men shared a grim flight over shattered sea walls, burning houses and a submerged roller coaster.

Speaking to storm victims at a community center in the hard-hit town of Brigantine, Mr. Obama said, “We are going to be here for the long haul.” Mr. Christie thanked the president for his visit, saying, “It’s really important to have the president of the United States acknowledge all the suffering that’s going on here in New Jersey.”