In his first public comments on a controversy that has gripped the nation, President Obama Friday spoke in unusually personal terms, calling the shooting of Trayvon Martin last month a “tragedy” and declaring “If I had a son, he’d look like Trayvon.”

He said, “we’re going to get to the bottom of what happened,” while avoiding making any specific comments about the legal details of the case. And he called for “soul-searching” to figure out how the incident escalated into a shooting of Martin by 28-year-old George Zimmerman.

“This is a tragedy. I can only imagine what these parents are going through,” he said in brief remarks after announcing his nominee to be the new head of the World Bank, responding to a question from a reporter.

PRESIDENT OBAMA SPEAKS ABOUT TRAYVON MARTIN AT THE WHITE HOUSE
[MSNBCMSN video=”http://www.msnbc.msn.com/id/45977840″ w=”592″ h=”346″ launch_id=”46834261″ id=”msnbc4d3e01″]

He added, “my main message is to the parents of Trayvon Martin; if I had a son, he’d look like Trayvon.”

The Justice Department has already said it is investigating the shooting, and Obama cited that process in responding to the question about his views on the case.

“Well, I’m the head of the executive branch and the AG reports to me, so I’ve got to be careful about my statements to make sure we’re not impairing any investigation that’s taking place right now,” he said.

He added, “When I think about this boy, I think about my own kids. And 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. So I’m glad that not only is the Justice Department looking into it, (but) I understand that the governor of the state of Florida has formed a task force.

Obama’s comments, while measured, are likely to be enthusiastically received by the thousands who are protesting the shooting of Martin in Sanford, Florida. Before Friday, the president’s spokesman had deferred questions about the shooting to the Department of Justice, and Obama had said nothing himself.

His decision to comment illustrated the intense public attention on the case. But the president was much more careful than in 2009, when he blasted police in Cambridge for their arrest of Harvard professor Henry Louis Gates Jr. His political advisers concluded Obama’s intervention into that controversy was unwise, and he has been reluctant to wade into such subjects since.

Still, Obama could have said nothing, as he often does when questions are shouted at him by reporters. That would have been particularly easy in this case, as he was announcing the nomination of Jim Yong Kim to run the World Bank, a matter completely unrelated to the shooting.

At the same time, the event was, perhaps, the president’s last chance to speak about the Martin case while on U.S. soil for several days, as he is heading to Seoul, South Korea for a nuclear summit late on Friday.

Follow Perry Bacon Jr. on Twitter at @perrybaconjr