In the hours after a gunman shot 12 police officers in Dallas, killing five, Republican presidential candidate Donald Trump and his Democratic rival Hillary Clinton abruptly canceled campaign events. Their Twitter accounts largely went quiet.

The shootings marked yet another convulsive event in the 2016 political season, one in which Clinton and Trump have scrambled to find the right response to terror attacks abroad, mass shootings at home, and protests over police killings of African-Americans.

Much of the violence, captured live on smartphones and endlessly replayed on cable television news, has fueled Americans' fears about their personal safety, polls show. It has evoked memories of 1968, when civil rights leader Martin Luther King and Democratic presidential candidate Robert Kennedy were assassinated in a turbulent era of protests against the Vietnam war and racial segregation.