President Obama referred to himself 45 times over the course of the speech he delivered Tuesday at the memorial service for the five police officers killed in Dallas last week.

Obama referred to himself twice before finishing his opening salutations and before mentioning the slain officers or their families. After noting the presence of President Bush, members of Congress and Dallas mayor Mike Rawlings, Obama appeared to go off-script.

[dcquiz] “Chief Brown, I’m so glad I met Michelle first because she loves Stevie Wonder,” Obama said, jokingly referencing Dallas Police Chief David Brown’s earlier speech in which Brown quoted lyrics from the song “As” in tribute to the deceased. The president looked around the room, pointed at Brown and cracked a grin while the audience laughed at and applauded his joke. “Most of all, the families…” Obama said, proceeding with his speech.

Obama would refer to himself 43 more times throughout the speech — most of which he personally wrote, according to the LA Times — including one instance where he referred to himself in the third-person: “the president.”

“Politicians calculate how to grab attention or avoid the fallout. We see all this, and it’s hard not to think sometimes that the center won’t hold. And that things might get worse. I understand. I understand how Americans are feeling. But, Dallas, I’m here to say we must reject such despair,” he said later.

“I’m here to insist that we are not as divided as we seem. And I know that because I know America. I know how far we’ve come against impossible odds. I know we’ll make it because of what I’ve experienced in my own life. What I’ve seen of this country and its people, their goodness and decency as president of the United States,” he continued.

The president also referred to himself while lamenting the apparent inefficacy of his own rhetoric. “I’ve seen how inadequate my own words can be,” he said.

The president has faced scrutiny in the past for his habit of talking about himself during national speeches.

Follow Peter Hasson on Twitter @PeterJHasson