The agents killed on Tuesday were the first who had been fatally shot in the line of duty since November 2008, when Special Agent Samuel S. Hicks, 33, was killed while serving a search warrant, according to the F.B.I.
Mr. Hicks was part of a team of agents executing an arrest warrant at a house near Pittsburgh that was connected to a drug trafficking ring, the bureau said.
The shooting on Tuesday was one of the worst in the history of the F.B.I.
In 1986, two agents were killed in Miami and five others wounded during the pursuit of two violent bank robbers who were also killed in the exchange. The gun battle at the Suniland Shopping Plaza in what is now the village of Pinecrest was the costliest in F.B.I. history.
In November 1994, two agents were killed, a third agent was wounded and a 15-year-old boy was shot in the leg when a man came into the cold case squad room of Police Headquarters in Washington and opened fire with an assault rifle, according to the F.B.I.
A police detective was also killed during the shooting. The gunman, a suspect in a triple killing a month earlier, had left notes saying he planned to kill members of the local police homicide unit, the F.B.I. said.
On Tuesday, police officers stood in a somber line saluting as a gurney carrying one of the bodies draped in an American flag was placed into a fire rescue truck at the Broward Health Medical Center in Fort Lauderdale. A procession of dark law enforcement S.U.V.s and motorcycles with sirens and lights then escorted the ambulance to the county medical examiner’s office.
Patricia Mazzei and Johnny Diaz reported from Miami, Adam Goldman from Washington, and Nicholas Bogel-Burroughs from New York. Katie Benner and Seamus Hughes contributed reporting from Washington, Maria Cramer from Maplewood, N.J., Gabriel J.X. Dance from New York, Michael Majchrowicz from Sunrise, Fla., and Pembroke Pines, Fla., and Christina Morales from Coral Springs, Fla., Weston, Fla., and Miramar, Fla. Susan C. Beachy contributed research.