WASHINGTON - President Barack Obama said on Wednesday police had acted stupidly in arresting a prominent black Harvard University scholar at his own home, weighing in on escalating debate over the treatment of minorities by U.S. law enforcement officers.

Obama, the United States' first black president, acknowledged at a prime-time White House news conference, he did not know all the facts about the arrest last week of Henry Louis Gates at his residence in Cambridge, Massachusetts.

But Obama, reciting details from news reports, left little doubt he felt Gates had been wronged in the incident, which has created a media furor.

Gates, a renowned expert on race whom Obama described as a friend, was detained for alleged disorderly conduct -- a charge that was quickly dropped -- after a confrontation with a white police officer inside his own house.

I don't know -- not having been there and not seeing all the facts -- what role race played in that, but I think it's fair to say, number one, any of us would be pretty angry, Obama said when asked about the case.

Number two, that the Cambridge police acted stupidly in arresting somebody when there was already proof that they were in their own home, he added.

While stressing that his own election last November was a testament to progress in race relations, Obama pointed out there was a long history in the United States of blacks and Hispanics being singled out disproportionately by police.

That's just a fact, he said.

He said Gates' arrest was a reminder that the race issue still haunts us.

'I'D GET SHOT'

The incident took place last Thursday when a woman called Cambridge police to report that a man was trying to force his way into the house.

Obama joked that if he ever tried to jimmy the lock at his current address -- the White House -- I'd get shot. The digression drew laughter from journalists who until then had peppered him with questions about healthcare and the economy.

Gates, 58, had found his front door jammed after returning from a trip to China, according to his lawyer. But police said Gates exhibited loud and tumultuous behavior, including accusing police of racism.

A statement on the Cambridge police department's Web site said, The City of Cambridge, the Cambridge Police Department, and Professor Gates acknowledge that the incident of July 16, 2009 was regrettable and unfortunate.

Gates is director of Harvard's W.E.B. Du Bois Institute for African & African American Research and is one of the most prominent black scholars in the United States.

(Additional reporting by Jason Szep in Boston and JoAnne Allen in Washington; editing by Chris Wilson)