César Suárez was shot dead in the port city of Guayaquil on Wednesday, the attorney general said.
A prosecutor investigating an attack on a TV studio in Ecuador last week has been killed, officials say.
César Suárez was shot dead in the port city of Guayaquil, Guayas province on Wednesday, the attorney general said.
It is not clear whether Mr Suarez’s death is linked to his investigation into the TV station attack.
During the dramatic incident last week, masked men burst into public TV channel TC’s studio during a live broadcast and threatened them at gunpoint.
Pictures that were broadcast live on air showed journalist Jose Luis Calderon pleading with the gunmen, while station staff were forced to sit or lie on the studio floor.
One cameraman was shot in the leg, while another’s arm was broken during the attack, TC’s deputy director of news said.
Local media reports that Mr Suárez was shot while driving near his office. Unverified footage on social media also shows a vehicle with bullet holes in the window.
In an interview with newspaper El Universo one day before his death, Mr Suarez said he had not been given police protection despite interrogating the 13 people arrested following the TV station attack.
His killing is the latest in a surge of violent incidents across Ecuador, which has seen the escape of two gang leaders from prison, hundreds of prison guards taken hostage and explosions in several cities.
In response, President Daniel Noboa declared a 60-day state of emergency and ordered the military to “neutralise” 22 armed groups which he redefined as terrorist organisations.
Reacting to Mr Suarez’s death, Attorney General Diana Salazar said: “It is impossible not to be broken by the death of a colleague in the fight against organised crime. We will remain firm in his name: for him, for the country, for justice.
“Thank you for your work, César. Rest in peace,” she wrote on X, formerly known as Twitter.