Santa Cruz Police Sgt. Loran "Butch" Baker, 51, and Officer Elizabeth Butler, 38, were fatally shot during what was described as a routine investigation of a former soldier with a criminal past.
A convoy of several hundred police officers, firefighters and emergency medical staff drove through the city Thursday.
Former Defense Secretary Leon Panetta attended the service and spoke.
About 6,000 people, mostly law enforcement and first responders, gathered in HP Pavilion, home of the San Jose Sharks hockey team, for the memorial. A few hundred more gathered in a basketball arena in Santa Cruz, watching a live stream.
"These officers were doing something I've done hundreds, if not thousands of times," said Tustin police Capt. Mike Shanahan, who drove 400 miles to represent his agency. "We're all thinking, there but for the grace of God go I."
The ceremony began with a slideshow and videos of both slain officers, showing them and their families as they grew up and became members of the force. Bagpipes echoed over their flag-draped coffins that stood at center stage, along with large photos, dozens of wreaths and two Santa Cruz Police Department cruisers.
Gov. Jerry Brown also planned to speak, and American Idol star James Durbin, a Santa Cruz local, was there to sing "Arms Wide Open."
Authorities allege that when the detectives went to Jeremy Goulet's door, he went out another exit and ambushed them with a .45 caliber handgun.
Laid off just days earlier, Goulet, 35, had a passport and an airplane ticket to New Mexico when he died a short time later.
Baker, who had been with the department for 28 years, is survived by his wife, son and two daughters. His son is a Santa Cruz police officer.
Butler, a 10-year veteran of the department, is survived by her partner, Peter Wu, and their two young sons.
They were the first Santa Cruz police officers killed in the line of duty.
A scholarship fund has been launched for the families.
The Associated Press contributed to this report.