President Obama, during a brief Rose Garden press conference meant to announce his nominee for World Bank president, ventured into the high-intensity controversy over the unarmed black teenager fatally shot in Florida -- calling the case a "tragedy" and saying if he had a son, "he'd look like Trayvon."
The death of Trayvon Martin, 17, is now under investigation by the Justice Department and FBI.
Obama, asked about the case Friday, noted that he doesn't want to interfere with the probe being led by his attorney general, Eric Holder. But he made clear that he empathizes deeply with the parents in the case, and called for investigators to "get to the bottom" of what happened.
"Obviously, this is a tragedy. I can only imagine what these parents are going through. And when I think about this boy, I think about my own kids. And, you know, I think every parent in America should be able to understand why it is absolutely imperative that we investigate every aspect of this and that everybody pulls together -- federal, state and local -- to figure out exactly how this tragedy happened," Obama said
He added: "But my main message is to the parents of Trayvon Martin. You know, if I had a son, he'd look like Trayvon."
The president said "all of us have to do some soul-searching to figure out how does something like this happen."
Federal investigators have opened a civil rights probe into the shooting. George Zimmerman, a neighborhood watch volunteer, claimed he shot Martin in self-defense.
Republican presidential candidates followed with statements.
Former Pennsylvania Sen. Rick Santorum said the shooting "horrible case."
He cited Florida's "stand your ground" law that gives people wide latitude to use deadly force rather than retreat during a fight but said, "Stand your ground is not doing what this man did."
Former Massachusetts Gov. Mitt Romney called the fatal shooting a "tragedy" and called for a full investigation.
In addition to the Justice Department and FBI investigations, a grand jury is considering whether to charge Zimmerman, who acknowledged shooting the teen but said it was in self-defense.
Martin's parents, civil rights activists and others have staged rallies and called for Zimmerman's arres.
Police Chief Bill Lee temporarily stepped down to try to cool the building anger that his department had not arrested Zimmerman.
Hours later, Gov. Rick Scott announced that the local state attorney, Norman Wolfinger, had recused himself from the case in hopes of "toning down the rhetoric" surrounding it.
Martin was returning from a trip to a convenience store when Zimmerman started following him, telling police dispatchers he looked suspicious. At some point, the two got into a fight, and Zimmerman pulled out his gun.
Zimmerman told police Martin attacked him after he had given up on chasing the teenager and was returning to his sport utility vehicle.
Obama cautioned before speaking that he must "be careful so we're not impairing any investigation." But he said he was glad the Justice Department was investigating and that Florida officials had formed the task force.
"I think all of us have to do some soul searching to figure out how did something like this happen, and that means we examine the laws and the context for what happened as well as the specifics of the incident," Obama said.
The case resonates with many black Americans, a key voting group during Obama's 2008 election, who see it as yet another example of bias toward blacks. Civil rights groups have held rallies in Florida and New York, saying the shooting was unjustified. Of Sanford's 53,000 residents, 57 percent are white and 30 percent are black.
Obama himself has tried to downplay race, as he did early in his term after the controversial arrest of Henry Louis Gates Jr., a black Harvard University professor, by a white police sergeant in Cambridge, Mass.
Gates was arrested in his own home after the police sergeant arrived to investigate a possible burglary. The charges were dropped, but Obama said the police had "acted stupidly," breathing life into a lingering debate. The president said later he should have expressed his concerns with different language and invited both Gates and Sgt. James Crowley to the White House for a beer.
-- The Associated Press contributed to this story.