WEST JORDAN -- LDS Church President Gordon B. Hinckley said guns and mental illness do not mix as he eulogized church security officer Donald Thomas who was slain by a gunman last week.

"A way must be found to keep the mentally ill from senseless acts of violence," President Hinckley said. "You cannot have an indiscriminate allowance of firearms without abuses. All of us cannot be held hostage by a few whose minds are sick and who lack judgment and reason."We cannot live and work in a bunker mentality," he said. "The very nature of our lives is based on our freedom to go and come while doing our work."

President Hinckley made his remarks Monday at funeral services for Thomas at the West Jordan Westbrook Stake.

The security guard was one of two people killed and three people wounded at the church's Family History Library Thursday before police mortally shot 70-year-old gunman Sergei Babarin. Babarin has been described as a man troubled by mental illness, including depression and dementia, and who had no current prescription for medication to control his illness.

"We are advised that his extended family knew of his illness and sought care," President Hinckley said of Babarin. "It is one thing to let such an individual go about freely in our society, but it is another thing to permit him to arm himself with an automatic weapon with which to cut down and kill, should he feel so inclined."

Police have said that despite having a past conviction on a misdemeanor weapons violation, Babarin was able to legally purchase in 1995 the .22-caliber semiautomatic Luger handgun he used in Thursday's shootings.

President Hinckley said the church and community are deeply indebted to security and police officers. "They acted so promptly and so efficiently in the circumstances to which they were called," he said.

"We are deeply grateful to them and wish for them to know of our gratitude. But they should not be called upon to risk their lives because of circumstances that are so unnecessary."

Jeffrey Hill, Thomas' bishop, also thanked the officers from four area police departments who offered a "tribute usually reserved for one of their own." Some 31 motor officers escorted the funeral procession from West Jordan to the Lehi cemetery.

Among the ranks of the motor squad was Salt Lake officer Brad Davis, whose thumb was grazed by one of Babarin's bullets during the shooting spree.

Joining President Hinckley in the tribute to the veteran church security officer were the presiding bishopric of The Church of Jesus Christ of Latter-day Saints, members of the Quorum of the Seventy and church security chief Richard Bretzing.

President Hinckley recognized Patricia Frengs, 55, of Pleasant Hill, Calif., who was also killed in the shooting, and three other women who suffered gunshot wounds. "I speak for the entire church when I convey my sympathy, my love and my blessing," he said. "To those who were in the family history building when all of this occurred, who sensed great and serious concern, who acted bravely and wisely, we extend our commendation and are grateful to the Lord that they were spared."

Thomas and a night watchman at the church's Mesa, Arizona temple are the only church security officers to lose their lives in the line of duty, President Hinckley said. "This entire episode was gruesome and terrible, and we hope that we shall never experience another such thing again."

President Hinckley characterized Thomas as a self-effacing man who cared for his family and did his duty without seeking praise or celebrity.

"I think he would look down upon this vast congregation today and say: 'How come? All of this for me?' This because of our love and appreciation and respect for him."

Tami Schmidt, Thomas' daughter, said her father's life was spent in service and love to many. "The things that complete strangers told me about my father made me love and appreciate him more in those 4 1/2 hours (during a viewing Sunday) than I have in my entire life.

"It was a horrible way to die. But because of it, other people lived and will remember him forever," she said. "I am certain that as he entered heaven, he said of the man who shot him, 'Father, forgive him, for he knows not what he does.' "

Son Kory Thomas said that if his father were able to greet the man who shot him, his father "would have his arm on his shoulder saying, 'Sir, I understand you were confused. You were misunderstood and you didn't know what you were doing.' And the gunman, on the other hand, would have said, 'If I only would have known what I was leaving behind, I would have never, ever, ever done this to you.' "

The family described their father as a man devoted to the care of his wife, KonaDee, who has multiple sclerosis.

"We wonder why one so urgently needed, particularly by his wife, would be taken from our midst," President Hinckley said. "I come to the conclusion that we do not know the demanding burdens that so many people carry. They go about their work from day to day without complaint or criticism. That before every day they arrive at work they have performed demanding duties at home, providing for those who are unable to take care of themselves, and working to ensure their comfort during the day while they, themselves, are absent."

President Hinckley said he frequently encountered Thomas while traveling to and from church offices. "He always greeted me, always said 'good morning -- good afternoon.' He quietly served wherever he was assigned. He was one of the older people in the church security department. He was a man of long experience who knew what was expected of him and who met those expectations. But it was never expected that he would be asked to give his life as he handled his duty.

"When all else fails," President Hinckley said, "when our hopes and dreams are shattered, when death strikes with certainty and finality, there is the voice of the Lord speaking to the sorrowing heart, and to all mankind: 'I am the resurrection and the life. He that believeth in me, though he were dead, yet shall he live. And he that liveth and believeth in me shall never die.' "