A Broward Sheriff’s Office deputy shot and killed a man who had injured himself in a Cooper City parking lot after the man went on the attack, authorities said.

Broward Sheriff’s Office deputies and Broward Sheriff Fire Rescue units responded to a call reporting a man had shot himself in the parking lot of a McDonald’s near the 10200 block of Griffin Road, off North Palm Avenue, early Saturday afternoon.

After locating the man, a deputy approached the man in an attempt to help him, investigators said.

The man then attacked the deputy, detectives said, forcing the deputy to discharge his weapon, striking the man.

The man as pronounced dead at the scene.

7News cameras captured the injured deputy on a stretcher as paramedics took him to an ambulance.

“Broward Sheriff Fire Rescue and Davie Fire Rescue transported a deputy and the man’s mother to a local hospital for treatment. Neither of them received gunfire injuries,” said BSO spokesperson Claudinne Caro.

Back at the scene of the deputy-involved shooting, 7News cameras captured the parking lot cordoned off with crime scene tape, as detectives combed the area and continued their investigation.

The Florida Department of Law Enforcement will investigate the shooting.