JAMESTOWN, Va. — A rather extraordinary experiment began on that searing-hot summer day in 1619 when 22 elected colonists gathered in a wooden church near the James River as the first representative body in the New World.

Four hundred years later to the day, President Trump flew here on Tuesday to celebrate the inauguration of what would become American democracy in lofty terms at a time when the state of American democracy feels to many to be perilous and even poisonous.

From a stage in a cathedral tent next to a replica of the Jamestown Settlement, Mr. Trump remained on his best behavior, sticking to the elevated if dutiful words in the script his staff gave him and praising the contributions of African-Americans. But both before and after the ceremony, with no text or teleprompter to guide him, he once again opted for fiery denunciations of political opponents of color.

He tore into what he called “Democratic-run corrupt cities” like Baltimore and again targeted its congressman Elijah E. Cummings and another critic, the Rev. Al Sharpton. “Those people are living in hell in Baltimore,” he said, because taxpayer money “has been stolen and wasted by people like Elijah Cummings.”