LONG BEACH, Calif. — Thousands of first responders gathered Tuesday to pay tribute to a veteran Southern California fire captain who was shot and killed after responding to an explosion last week.

Throngs of firefighters and police officers stood shoulder-to-shoulder and saluted as a fire truck carrying the flag-draped coffin of Capt. Dave Rosa arrived at the Long Beach Convention center for his funeral.

"For those of you who knew Dave, you were truly blessed," Assistant Fire Chief Xavier Espino told mourners.

As the service began, a troop of bagpipers played, "Amazing Grace." The 17-year veteran firefighter is survived by his wife, Lynley, and two sons, Alec and Sam.

"Dave knew the value of family and he always made it his priority," his brother-in-law, Chris Hensely, a fellow firefighter, said. "He was a champion of a husband and father, a champion of a man."

Family members remembered Rosa as a family man who was devoted to his wife and his children and loved being a firefighter.

"Underneath that tough outside, he was the most caring and loving human being that I know," said Rosa's friend, Kevin Landino.

The day his father died Alec Rosa cried for about 10 hours, he said during the funeral.

"When you hear something like that, it doesn't really register. I just sat in shock," he said. "My dad's a fireman, firemen aren't supposed to get shot."

The encounter that took Rosa's life unfolded last Monday when, according to authorities, Thomas Kim, 77, set off an explosion at a retirement home in Long Beach in an attempt to kill his neighbor.

After the explosion, authorities said, Kim sat at the end of a hallway and shot at firefighters who were searching the building.

Rosa was killed and firefighter Ernesto Torres was wounded. A third person — an elderly resident who lived in the building — was also wounded.

Investigators found a note that led them to believe the incident was an attempted murder-suicide, though detectives are still working to determine an exact motive.