TUCSON — President Obama called Wednesday for an end to the political finger-pointing that has erupted in the aftermath of the gunman’s rampage here five days ago, urging Americans not to use the tragedy that took six lives to turn on one another.

In a widely anticipated address, a somber Mr. Obama told more than 14,000 people in a gymnasium at the University of Arizona — and millions watching on their television sets — that it was time to “pause for a moment, and to make sure that we are talking to each other in a way that heals, not a way that wounds.”

“Scripture tells us that there is evil in the world, and that terrible things happen for reasons that defy human understanding,” Mr. Obama said. “Bad things happen, and we must guard against simple explanations in the aftermath.”

The reality, the president said, is that “none of us can know with any certainty what might have stopped those shots from being fired, or what thoughts lurked in the inner recesses of a violent man’s mind.”

He praised the people who rushed to the scene last Saturday in Tucson; the two men who wrestled Jared Loughner to the ground; the woman who seized his ammunition, the intern who rushed to the side of Rep. Gabrielle Giffords to try to stem the bleeding.

Wednesday night’s memorial service was finally the time to break away from the cacophony of the past five days, with its accompanying accusations that vitriol on the airwaves contributed to the tragedy and counteraccusations of political opportunism. Instead, the service was finally a chance to pay homage to the six lives that were taken.

“The loss of these wonderful people should make every one of us strive to be better in our private lives – to be better friends and neighbors, co-workers and parents,” Mr. Obama said. “And if, as has been discussed in recent days, their deaths help usher in more civility in our public discourse, let’s remember that it is not because a simple lack of civility caused this tragedy, but rather because only a more civil and honest public discourse can help us face up to our challenges as a nation, in a way that would make them proud.”

The service reached an emotional peak when Mr. Obama spoke of his visit at the hospital earlier Wednesday with Ms. Giffords. Looking at Ms. Giffords husband, Mark Kelly, seated in the front row, Mr. Obama said that Mr. Kelly had given him permission to tell the crowd that a few minutes after the Obamas left Ms. Giffords, “Gabby opened her eyes for the first time.” As the crowd erupted into a standing ovation, Mr. Obama continued: “She knows we are here, she knows we love her, and she knows we are rooting for her.”

The scene at McKale Arena at the University of Arizona was a surreal mix of grief and celebration; it seemed to be part church service, part political rally, under the auspices of a college basketball event. Arizona Wildcats championship banners hung on the rafters above while long lines of people queued up at the concession stands for Cokes.

“Omigod where do you think Obama is right now?” one woman said excitedly, about an hour before the service began. (Mr. and Mrs. Obama, at the time, were meeting with family members of the victims).

About two rows away, another woman sat a little apart, in the middle of an empty row, tears trickling down one cheek as the choir sang Amazing Grace. A few seats from her, Susan Spotts, a Tucson homemaker, sat in a wheelchair, taking photos on her mobile phone of her daughter, Crystal, a physical therapy assistant. “Political discourse has no place here,” the elder Mrs. Spotts said.

Immediately after Air Force One landed in Tucson Wednesday afternoon, Mr. and Mrs. Obama headed to the hospital to see Ms. Giffords and other people injured in the shooting on Saturday. The Obamas also met with family members of the victims.

“The president wanted to begin this solemn trip by stopping first at the hospital where Congresswoman Giffords and others continue to recuperate,” White House Press Secretary Robert Gibbs said.

Doctors said that Ms. Giffords’ condition is improving and that she is spending less time under sedation.

Mr. Obama’s aides have been keenly aware of the potential for Mr. Obama’s words to further enflame an already heated political debate around the country.

The timing of the release of a video by Sarah Palin, in which she accused her detractors of “blood libel” in their criticisms, further amplified the question of whether Mr. Obama would use the occasion of the memorial service to address the tone of the country’s political debate.

He did not, instead using his remarks to call for Americans to move beyond the divisive debate. “What we can’t do is use this tragedy as one more occasion to turn on one another,” Mr. Obama said. “Rather than pointing fingers or assigning blame, let us use this occasion to expand our moral imaginations, to listen to each other more carefully, to sharpen our instincts for empathy, and remind ourselves of all the ways our hopes and dreams are bound together.”