The officer’s coffin was covered with a French flag and placed at the center of a courtyard in a ceremony that served as a powerful reminder of the perilous times in which the elections were taking place and of the heavy price paid by French security forces in recent years. A minute’s silence was held in police stations across France.

Officer Jugelé, 37, was shot in the head on Thursday while at the wheel of a parked police van. He has been posthumously promoted and awarded the Legion of Honor. Two other police officers and a bystander were wounded in the attack.

In a personal and moving elegy, Mr. Cardiles described the man he loved in vivid terms. “You went to your job at 2 p.m. in the clothes that you wore when maintaining order, of which you took so much care,” he said. “I know you enjoyed this type of mission; I know, because it was the Champs” — meaning the Champs-Élysées — “and the image of France, because it was also culture that you were protecting.”

Mr. Cardiles then shifted to the night of the attack, saying that when he had heard there had been an attack on the Champs-Élysées and that a police officer had been killed, “A little voice inside told me that it was you.”