SAN JOSE — The long day of grieving began at the seaside town in the early morning hours, then slowly made its way “over the hill” in a long procession before reaching a hushed arena. There, thousands gathered, both in uniform and civilian clothes, to tearfully celebrate and mourn the lives of two Santa Cruz Police Department detectives slain in the line of duty.

In a heart-wrenching memorial punctuated by the sad wail of bagpipes through HP Pavilion, as well as sounds of quiet crying, Detective Sgt. Loran “Butch” Baker and Detective Elizabeth Butler were remembered time and time again in one, simple way: They were two cops dedicated to making their small city safe.

“Two heroes, two friends, taken from us far too soon at the hands of a madman,” said Santa Cruz police Chief Kevin Vogel. “Someone sick and unstable, and yet someone who would have gotten a fair shake from Butch and Elizabeth if he had just given them a chance.”

Their deaths on Feb. 26 marked the darkest day in Santa Cruz Police Department history — the first time officers had been killed on the job — and was a tragedy that reverberated across the Bay Area and beyond.

Crowd estimates ranged from 6,500 to 8,500 people — a majority of them from the public-safety community with black stripes across their badges. They were joined by dignitaries including Gov. Jerry Brown and state Attorney General Kamala Harris. Hundreds more were watching live feeds of the three-hour service at venues back in Santa Cruz. Countless others lined city streets and Highway 17 to see the passing hearses.

It was a painful final salute. The two flag-draped caskets were flanked by large photos of Butler and Baker. Honor guards took turns watching over the fallen detectives.

Speakers struggled to control their emotions. That would be a challenge for everyone at one especially poignant moment when Butler’s 5-year-old son was on the stage wearing his mother’s Santa Cruz Police Department hat.

Recently retired U.S. Secretary of Defense Leon Panetta, a Carmel Valley native, said the gunshots that shattered the quiet just over a week ago not only “took the lives of two fine officers, but those bullets ripped the fabric of our community.”

The toughest duty he’s ever had, Panetta continued, was writing the families of those lost in combat.

“The only words of comfort I could find was that their loved ones gave their lives for their country to help keep us safe, and that act of unselfish sacrifice made them heroes forever,” he said. “These officers also were warriors fighting to keep us safe, and they too gave their lives.”

The laid-back surfing town of Santa Cruz has been in a state of mourning since Butler and Baker were ambushed by Jeremy Peter Goulet, who later was killed in a shootout with law enforcement. Thursday was a chance for the police community to gather as one, filling HP Pavilion with the uniforms of law enforcement across the state.

The service was moved over the Santa Cruz Mountains to San Jose because there was no indoor venue in the city of 60,000 to accommodate the crowd. The motorcade departed from the Santa Cruz Beach Boardwalk before 9 a.m. to begin the 35-mile journey on serpentine Highway 17 and into San Jose.

Employees spilled out of businesses along West Julian Street to watch the procession pass.

“It’s just so emotional,” said Lori Smith, a public health nurse, who joined a crowd at Julian and Highway 87. “These are people who put their lives on the line every day. We have our own drama at work, and it just seems so trivial.”

Outside the arena, Santa Cruz street-sweeper Frances Olson said it was an honor to be at the service. “They were just doing their job, and here they got killed,” Olson said.

James Burtnett, 57, of Santa Cruz, was close enough to hear the gunshots the day Baker and Butler died. From a family of law enforcement, Burtnett said the possibility of losing loved ones always has been in the back of his mind.

“It makes me think about my family,” said Burtnett, a retired carpenter. “You know when they walk out that door they might not come back.”

The Shark Tank, so often the site of joy and cheers, was transformed into a place of somber reflection.

Baker, 51, a 28-year veteran and father of three, including a son on the Santa Cruz force, was lauded as a tenacious seeker of the truth. But Baker also was recalled as a larger-than-life personality who loved to wear shorts and play practical jokes.

He was a devoted fan of the Sharks, Giants and NASCAR who, cracked Santa Cruz Deputy Police Chief Steve Clark, sometimes would gun his cruiser like a stock car so loud late at night that you always would know where he was patrolling in the city.

“It’s good to laugh, isn’t it?” Clark said at one point. But soon, Clark was choking back tears.

The audience learned that Butler, 38, a 10-year veteran, was better known as “Beth” to friends. She loved checking out large numbers of books from local libraries and snuggling up each night in bed with sons Joaquin, 5, and Stellan, 2, to read with them.

Alexis Butler spoke of her little sister’s competitive drive to win games and solve mysteries.

“Beth was stunning in heels,” she added. “She was the first to be noticed. She was tall. She was willowy. She loved to dance. … Elizabeth Butler made life fun instead of a chore.”

When Peter Wu took the microphone next, he held in his arms their son Joaquin. The young boy held a teddy bear.

“I promise that I will take care of our boys and always tell them what a great person you were,” Wu said, haltingly. “I promise our boys will grow up to be upright, to be gentle, to be loving.”

After an emotional version of “Arms Wide Open” by former “American Idol” contestant James Durbin, who grew up in Santa Cruz and knew Baker from when the detective chaperoned high school dances, the families were presented folded American flags.

Outside the arena, law enforcement then lined both sides of Autumn Street as “Taps” was played by buglers. They stood at attention, saluting, as the two hearses slowly moved past. Above them, extended ladders from fire trucks held aloft a huge American flag, and seven helicopters crossed the sky.

Then, the procession began the long, final trip home.

Contact Mark Emmons at 408-920-5745.