Police Mourn Baton Rouge Officer Matthew Gerald

A law enforcement officer and a veteran salute one another at a funeral service for police officer Matthew Gerald at Healing Place Church in Baton Rouge, Louisiana on Friday. Jonathan Bachman/Reuters

Police officers from across the United States gathered at a church in Louisiana's state capital with hundreds of other mourners on Friday for the first of three funerals for policemen killed this week by an Iraq war veteran.

American flags lined the entryway to the Healing Place Church for the funeral of Baton Rouge Police Officer Matthew Gerald, a married father of two children who also served in Iraq.

Gerald and two colleagues were killed and three were wounded on Sunday by Gavin Long, 29, a black former Marine from Kansas City, Missouri, in the aftermath of the police killing of an unarmed black man in Baton Rouge on July 5. The shootings were the latest in a series of deadly encounters that have sparked debate over policing and minorities in the United States.

Friday's mourners included a police contingent from Dallas, where five officers were killed on July 7 by another black former U.S. serviceman.

"We felt it was very important to come support Baton Rouge today," said Christina Smith, a deputy chief with the Dallas Police Department.

Louisiana Governor John Bel Edwards also was scheduled to attend the service.

Funerals for the other slain officers—East Baton Rouge Sheriff's Deputy Brad Garafola and Officer Montrell Jackson of the Baton Rouge Police Department—will be held on Saturday and Monday, respectively.

The three officers were gunned down in what Louisiana officials have described as a calculated attack by Long. The shooting rattled a city already grappling with protests after the fatal police shooting on July 5 of Alton Sterling, a 37-year-old black man confronted by officers while selling CDs outside a convenience store.

Police said Long had intended to kill as many officers as possible before a SWAT team marksman fatally shot him. The wounded officers include a sheriff's deputy who remains in critical condition after being shot in the head and stomach.

Another of the wounded, Deputy Bruce Simmons, left a Baton Rouge hospital on Thursday after surgeries to repair serious arm injuries.

Gerald, 41, had served on the police force for less than a year. He was a veteran of both the U.S. Marines and the U.S. Army.

Two armed forces flags flew alongside a law enforcement flag near the entrance of the church on Friday to honor Gerald's military and police service.