FORT MYERS, Fla. - The deadly shooting spree in Colorado consumed the presidential campaign Friday, sidetracking a bitter political contest with a tragedy that at least temporarily brought the candidates together in common purpose.

"There are going to be other days for politics," a somber President Barack Obama said.

The president and likely Republican challenger Mitt Romney rushed not only to respond to the killings but to distance themselves from a campaign that has become increasingly petty and bitter. Obama limited his campaign appearance in Fort Myers to remarks of less than eight minutes, devoted exclusively to the tragedy.

"It reminds us of all the ways that we are united as one American family," he said. He paused at one point to ask for a moment of prayer that lasted 20 seconds. A baby's cries pierced the silence.

Romney embraced the same sentiment of unity in Bow, N.H., where he had been scheduled to campaign.

"We'll all spend a little less time thinking about the worries of our day and more time wondering about how to help those who are in need of compassion most," he said in briefer remarks before a subdued audience. "The answer is that we can come together. We will show our fellow citizens the good heart of the America we know and love.

Obama canceled a second appearance scheduled near Orlando, Fla., and returned to Washington. Romney, too, canceled some media interviews. Both candidates moved to pull all their political ads airing in Colorado, and canceled appearances by their surrogates on the Sunday morning television talk shows.

The president was notified at dawn at his hotel near West Palm Beach, Fla., by his counterterrorism adviser, John Brennan. The White House said there was no apparent connection to terrorism.

Obama, Vice President Joe Biden and top White House aides were to receive a briefing on the investigation from Brennan and FBI Director Robert Mueller in the Oval Office after Obama returned.

In memory of the victims, the president also ordered that the U.S. flag be flown at half-staff through July 25.

"Our time here is limited, and it is precious," Obama said in Fort Myers. "What matters at the end of the day is not the small things. It's not the trivial things which consume us and our daily lives. Ultimately, it's how we choose to treat one another, and how we love one another. It's what we do on a daily basis to give our lives meaning and to give our lives purpose."

Romney said he joined the president and first lady in extending condolences "for those whose lives were shattered in a few moments, a few moments of evil in Colorado."

"I stand before you today not as a man running for office, but as a father and a grandfather, a husband, an American," he added. "This is a time for each of us to look into our hearts and remember how much we love one another and how much we love, and how much we care for our great country. There's so much love and goodness in the heart of America."

For Romney, the tragedy was a moment to express himself as a national consoler, a sad and grim task every president in recent decades has had to play.

"Today we feel not only a sense of grief but perhaps also of helplessness," he said. "But there is something we can do. We can offer comfort to someone near us who is suffering or heavy laden. And we can mourn with those who mourn in Colorado."

The assault apparently by one shooter killed 12 people and injured at least 50 others in one of the deadliest mass shootings in recent U.S. history.

The enormity and horror of the incident immediately injected a new tone to the campaign, essentially demanding that both candidates for the time halt politics and attend to the nation's shock at the tragedy.

Obama sought to temper the campaign spirit of those at his event to fit the mood of the day. He thanked supporters and said he had looked forward to talking about the differences between Romney and him, saying instead: "This, I think, is a day for prayer and reflection."

Nevertheless, at the end of his remarks about a nation that supports its own and appreciates its blessings, Obama's supporters added a political touch by chanting "Four more years!"

The shootings instantly injected the volatile issue of gun rights, which had been missing from the campaign, into the debate.

New York Mayor Michael Bloomberg, in a radio interview, admonished the president and his challenger to forcefully address gun violence.

"You know, soothing words are nice, but maybe it's time that the two people who want to be president of the United States stand up and tell us what they are going to do about it, because this is obviously a problem across the country," he said.

Obama said he viewed the moment through the eyes of a parent, noting that his 14- and 11-year-old daughters go to the movies.

"What if Malia and Sasha had been in the theater?" he asked. "Michelle and I will be fortunate enough to hug our girls a little tighter tonight, and I'm sure you will do the same with your children. But for those parents who may not be so lucky, we have to embrace them and let them know we will be there for them as a nation."

The shooting brought a halt to political events around the country.

Many were canceled or postponed Friday, from Senate Republican Leader Mitch McConnell's news conference on Capitol Hill to a Democratic event in Reno, Nev., on funding for an alert system for missing children. Biden canceled a fundraiser in Texas, and first lady Michelle Obama did the same for planned campaign events in Virginia. Romney's wife, Ann, called off her scheduled event in Michigan.

The tragedy inspired unifying statements, rather than partisan pronouncements, from the nation's leaders.

"I join President Obama, and every American, in sending my thoughts and prayers to the victims of this awful tragedy," said House Speaker John Boehner, R-Ohio. "We will all stand with them, as one nation, in the days ahead."

"The thoughts and prayers of all members of Congress are with Coloradans this morning," said House Democratic Leader Nancy Pelosi, D-Calif.

In Fort Myers, there was none of the customary music to usher the president out. People seemed sad as they left.

Said Diane Buckley of Fort Myers: "I liked that someone in a position of leadership can be as emotional as that and take a moment to value the people we love and to reach out to others."

Complete coverage: 'Dark Knight' shooting in ColoradoJames Holmes barged into a crowded Denver-area theater during a midnight showing of the Batman movie on Friday, hurled a gas canister and then opened fire, killing 12 people and injuring at least 50 others in one of the deadliest mass shootings in recent U.S. history, officials say. Cops: 12 dead, 11 critical, 58 wounded in CO shootingAs the new Batman movie played on the screen, a gunman dressed in black and ... LI cops, NYPD add patrols for 'Dark Knight'NYPD Commissioner Ray W. Kelly said the department will increase police presence at theaters showing "The Dark Knight Rises." Is there a link between the film and the shooting? There are general parallels to the shooting, "The Dark Knight" and the comic book character.

Most popular Nation stories

Nation/World top stories

News Photos and Videos Hurricane Michael: Latest photos from the storm Drone video of devastation left in Mexico Beach
[null, {"document_url": "https://www.newsday.com/news/nation/dark-knight-shootings-spurs-president-obama-mitt-romney-to-pull-down-negative-ads-1.3850026", "unformatted_src": "https://cdn.newsday.com/polopoly_fs/1.3850500.1352160150!/httpImage/image.jpg_gen/derivatives/landscape_768/image.jpg", "src": "https://cdn.newsday.com/polopoly_fs/1.3850500.1352160150!/httpImage/image.jpg_gen/derivatives/landscape_768/image.jpg", "formatted_filename": "image", "alt_text": "President Barack Obama and Republican presidential candidate Mitt", "rendered_width": 768, "rendered_height": 431}, null, null, null, null, null, null, null]