El Salvador's top human rights official has said that police and soldiers executed members of the country's street gangs and then pretended that they had died in gunfights that never took place.

Human Rights Ombudsman David Morales said he had reached these conclusions after a nine-month investigation of two incidents last year.

He said the first involved the execution in March 2015 of eight gang members, including one child, by members of the national police force, at a ranch about 20 miles south of the capital, San Salvador.

The investigation also found that the Salvadoran army lied about what really happened in another clash with gang members in August last year, when the army reported that soldiers killed five gang members during a gunfight in Panchimalco, also near the capital.

The prosecutor said the investigation was based on autopsies, interviews with the survivors, and visits to the places where the alleged clashes happened. Morales also said the army refused to help with his probe and that the police had made only a minimum effort to do so.

"The state cannot be the same or worse than the criminals," Morales said at a press conference to present the results of his investigation on Monday.

The ombudsman added that such practices also risk fueling the extreme violence already battering the tiny Central American nation where bloodthirsty street gangs control large parts of most major cities.

"If the state begins to exercise illegal violence as it did in the 1980s, and this is tolerated, the only thing that will happen is that the violence will escalate," he said, recalling the terror of government death squads during the civil war that ended with peace accords signed in 1992. "It will bring an even worse response from the gangs."

This human rights report comes in the midst of an intensification of the government's existing hard line against the gangs, the most important of which are the Mara Salvatrucha (MS-13) and the Barrio 18.

El Salvador ended last year as the most violent peacetime nation in the world with a murder rate of 104 killings per 100,000 inhabitants. This year the national police have reported 2,230 people killed up until April 20. That's an increase of 158 percent from the same period in 2015.

"All members of the PNC (National Civil Police) that have to use weapons against criminals due to their work as officers, should do so with complete confidence," Police Director Mauricio Ramírez told reporters last year. "There is an institution that backs us. There is a government that supports us."

According to police figures, there have been 130 shootouts between the security forces and street gangs so far this year in which 159 gang members were killed. The same figures show that only three police officers and two soldiers have died in those clashes.

Last week, the El Salvadoran legislature approved legal changes that formally classify the gangs as terrorist organizations. The changes also foresee 15-year sentences for anybody who gets involved in any kind of negotiation with them.

These reforms came after gangs threatened to kill security forces on sight after the government refused to support a truce between the two main groups. According to Attorney General Luis Martínez, 50 police officers have been killed in gang attacks in 2016.

In a video posted on YouTube last month, alleged leaders of the Mara Salvatrucha and Barrio 18 gangs said they reached a three-day truce in order "to show the government our willingness to stop the killing and that the hardening of the anti-terrorism law isn't necessary."

Since then, the government has also created a new anti-gang military unit to pursue gang members in rural areas.

Critics alleged that such measures along with prosecuting gang members and criminalize dialogue with them will only made things worse.

"It is a great pity that El Salvador is approving these kind of laws that criminalize civilized solutions that throughout history have been used to resolve social problems," said human rights activist Raul Mijango. "They just use repression."

Mijango, who was the mediator of a truce between the gangs in 2012, also believes the human rights prosecutor's investigation confirms that there are "extermination groups that are being tolerated by the State."

Rather than refuting the conclusions in the report, Defense Minister David Munguía said that all human rights investigations are being dealt with legally.

"We do not deny it," he said. "We are investigating."

Watch: Gangs of El Salvador (Full Length)