Police Sgt. James M. Crowley (left) listens as police union officials speak at a news conference in Cambridge, Mass. Reuters

WASHINGTON -- President Barack Obama tried to step back from the contretemps over the arrest of African-American scholar Henry Louis Gates Jr., saying he "could have calibrated" his words differently when he said police had "acted stupidly" in handling the situation.

The president's highly unusual appearance at press secretary Robert Gibbs's daily briefing came just hours after Massachusetts police unions demanded that Mr. Obama apologize for implying racial bias may have been a factor when the Harvard professor was arrested at his home in Cambridge, Mass. Mr. Obama personally telephoned the arresting officer, Sgt. James Crowley, who in turn suggested that he, Mr. Gates and the president have a beer at the White House.

President Obama said Friday he should have chosen his words more carefully when he said police 'acted stupidly' in arresting a prominent Harvard scholar. Reuters

The president then called Mr. Gates and suggested the professor join the president and the policeman at the White House.

"We may put that together," Mr. Obama said, adding that Officer Crowley also asked for help getting the media off his lawn.

The racial firestorm surrounding the country's first African-American president came as a shock to the White House, which had spent the prior two days dismissing it as a media creation.

Mr. Obama and his youthful black political allies, such as Massachusetts Gov. Deval Patrick, have spent their careers avoiding racial controversy and attempting -- with much success -- to redefine racial politics. But both men have been swept into the Gates controversy by words that highlight how deep the divide between blacks and whites remains on some issues, especially the actions of police.

Mr. Obama, in coming close to apologizing, conceded that the hard feelings on both sides were real and revealing. "The fact that it has garnered so much attention, I think, is a testimony to the fact that these are issues that are still very sensitive here in America," he said.

The July 16 incident erupted after a neighbor told police she thought someone was breaking into Mr. Gates's home. Mr. Gates, who had just returned from a trip, explained to Sgt. Crowley that it was his residence and subsequently accused police of racism and continued to berate the officer while following him outside. After warning the professor, Sgt. Crowley arrested him for disorderly conduct and took him into custody for several hours.

The president's handling of the matter was reminiscent of the last time racial divisions threatened him politically. Last spring, then-Sen. Obama laid low for days as the racially charged speeches of his former pastor, Jeremiah Wright, scorched his presidential candidacy. Once he moved, Mr. Obama sought to turn the issue into a "teachable moment," a term he again used Friday, with a March 2008 speech in Philadelphia on race and the deep hurt on both sides of the divide.

President Barack Obama backed down on Friday from a statement that police "acted stupidly" when they arrested prominent black Harvard scholar Henry Louis Gates. Video courtesy of Fox News.

Since his inauguration, he has downplayed his African-American identity, waiting until last week to address a largely black organization. That speech to the NAACP held the pointed message that African-Americans had "no excuses" for failure.

Police officials all but forced the president to jump back into the matter Friday, holding a news conference in Massachusetts to say that he and Mr. Patrick insensitively shot from the hip when they suggested bias had a role in Mr. Gates's arrest. Sgt. Crowley was at the news conference Friday, along with at least 20 other officers and lawyers showing support for him.

"The president should make an apology to all law-enforcement personnel," said Steve Killian, president of the Cambridge Police Patrol Officers Association.

To many African-Americans -- including Mr. Obama -- his comments stated the obvious: That a man shouldn't be arrested in his own home after proving he belongs there, regardless of any anger he expresses toward police.

The Cambridge police department has dropped all charges against Mr. Gates; he has demanded an apology from Sgt. Crowley, who has refused. The president reiterated that he still believes "pulling Mr. Gates out of his home to the station" was an overreaction.

Clear to all sides are the political ramifications of the flap. Both the National Republican Senatorial Committee and the National Republican Congressional Committee have used it to try to drive a wedge between the president and conservative Democrats in Congress, and to cast him as hostile to law-enforcement officers -- a politically damaging label Democrats have long been tarred with.

And Mr. Obama said the controversy is swamping his efforts to drum up support for his health-care overhaul.

The president himself acknowledged that the way he portrayed the incident inflamed tensions. When Mr. Obama was asked about the Gates arrest at a Wednesday night news conference about health care, he initially said he didn't have all the facts. At that point, the president should have stopped, said Alan McDonald, counsel to one of the Cambridge police unions.

One of those facts was that police said it looked like someone tried to break into Mr. Gates's house while he was away. Another was that Sgt. Crowley had taught a racial-profiling class at a police academy for the past five years.

In saying police acted "stupidly," the president "used the right adjective but directed it to the wrong party," said Dennis O'Connor, president of the union that represents Sgt. Crowley.

But Mr. Obama took sides. At his Wednesday briefing, he said: "I think it's fair to say, No. 1, any of us would be pretty angry; No. 2, that the Cambridge police acted stupidly in arresting somebody when there was already proof that they were in their own home."

Mr. Patrick went further, calling the arrest "every black man's nightmare and a reality for many black men."

That decision to jump in runs counter to the care both men have taken in their political careers. The question is, were they motivated by their race and personal experiences? Mr. Obama, the son of an African man and a white woman, wrote in great depth about his struggles with his racial identity in his memoir, "Dreams From My Father," starting with his grandmother's fear of a black man at a bus stop.

Kenneth Edmonds, chief of staff to Rep. Jesse L. Jackson Jr., and a fellow South Side Chicago African-American, said the president's outburst Wednesday came not because of his race but because of his professional background. He is a constitutional lawyer, steeped in complex legal issues, who as an Illinois state senator worked on racial profiling. He knows Mr. Gates personally, and as a Harvard law graduate he knew the setting of the confrontation, an affluent neighborhood just off Harvard Square.

"He had the knowledge and confidence that he could address this issue very carefully," Mr. Edmonds said.

But Mr. Obama alluded to the depth of blacks' feelings when he said, "because of our history, because of the difficulties of the past, you know, African-Americans are sensitive to these issues. And even when you've got a police officer who has a fine track record on racial sensitivity, interactions between police officers and the African-American community can sometimes be fraught with misunderstanding."

Write to Jonathan Weisman at jonathan.weisman@wsj.com and Simmi Aujla at simmi.aujla@wsj.com