Thousands of law enforcement officers stood at attention to form a wall Friday outside one of Houston's largest churches as a 21-gun salute and flyover by police helicopters were carried out in honor of a slain sheriff's deputy.

The symbolic gestures followed the funeral for Harris County Sheriff's Deputy Darren Goforth, who was gunned down at a gas pump a week ago.

"We come to this place with heavy hearts, and have questions we don't really understand," Lt. Don Savell, the sheriff's department chaplain, said as the ceremony began. "We gather to share the grief we all feel and perhaps to find the strength to bear our sorrow and to look for seeds of hope."

Second Baptist Church, which holds 7,000 people, was filled. Some officers stood outside and watched the nearly two-hour service on big-screen televisions, while other spectators gathered outside the suburban convenience store where Goforth was killed to view the funeral on screens set up there. Flowers, balloons, posters and written messages in memory of Goforth still surround the pump where he was shot.

Goforth, 47, was in uniform when he was killed while putting fuel in his patrol car. A 30-year-old Houston man is charged with capital murder. Investigators are still trying to determine a motive.

"Darren Goforth was one of the good guys, one that made a difference," Sheriff Ron Hickman said during the funeral. He said Goforth's life was taken "senselessly and in an act of cowardice" the night of Aug. 28 but that he and others "will answer calls in Darren's honor."

He said about 11,000 officers from "coast to coast" had come to pay respects.

Outside the church after the service, Hickman gave Goforth's wife, Kathleen, the flag that had been draped over the casket.

A line of patrol cars formed a large cross in the parking lot, and two Houston fire trucks with ladders extended formed an arch with a flag extended at the top. People lined streets as the funeral procession drove away. A private burial was planned.

Officers at various Texas law enforcement departments held moments of silence outside their buildings around the time of the funeral.

The killing brought out strong emotions in the law enforcement community, with Hickman suggesting last weekend that it could have been influenced by heightened national tension over the treatment of blacks by police. Goforth was white and the man charged with killing him, Shannon Miles, is black.

The Rev. Ed Young told those at the funeral that he fears evil has reached an "almost epidemic stage" with attacks on those who "wear the blue" — a reference to the police uniform.

But he said he's seen signs of hope in the wake of Goforth's death, with people being supportive of officers and openly praying for them.

"Things are changing," Young said. "There will be a new Houston, a new Texas, a new America.

"And you can write it down. We have your back," he told officers as the funeral crowd stood and applauded.