Marathon bombing hero and peace activist Carlos Arredondo has settled a police brutality case against four Boston cops who arrested him as he prepared to salute the late U.S. Sen. Edward M. Kennedy’s funeral procession in 2009.

Arredondo came to an agreement with City Hall for an undisclosed sum after five hours of mediation at the John Joseph Moakley Courthouse.

“We were able to, with the help of a mediator, resolve and settle the case to everyone’s satisfaction,” said Bruce Macdonald, Arredondo’s attorney. Macdonald declined to discuss the terms of the agreement yesterday. Arredondo declined to comment.

Arredondo claimed that police officers David Roberto, Francisco Rodriguez, Bienvenido Delacruz and Dana Lamb forcefully arrested him after he was asked to move his pickup truck — decorated as a shrine to his son, killed in the Iraq War — parked in front of Boston Police Headquarters.

Arredondo said he did not move because he was waiting for his wife, Melida, and needed time to remove an American flag flying from a 26-foot pole. Roberto called in Rodriguez, Delacruz and Lamb, and they “dragged” Arredondo to the sidewalk next to his truck, according to Arredondo’s civil complaint. Once on the sidewalk, Arredondo’s complaint claims, he “was thrown to the pavement, facedown, and handcuffed with his arms behind his back.”

Boston police denied any excessive force was used on Arredondo in their response to the suit. City attorneys declined to comment yesterday. The settlement precludes the need for a trial, which would have been heard before federal Judge Dennis Saylor IV.

Macdonald also alleged Boston police were watching Arredondo due to his “anti-war and peace movements in the Boston area and nationwide.” He said they gathered “intelligence reports” on Arredondo and “improperly retained the information for years,” citing a 2012 American Civil Liberties Union report. Police denied the allegation in court papers.

Arredondo, known for his iconic cowboy hat, gained worldwide fame for his heroic actions during the 2013 Boston Marathon bombings. He ran to the aid of victim Jeffrey Bauman, now a double amputee.