Two police officers have been killed and two seriously wounded in a clash with gang members outside El Salvador's capital.

The attorney general's office said Tuesday through its official Twitter account that the fight with members of the Barrio 18 gang occurred in a rural area in the department of Cuscatlan northeast of San Salvador.

According to the attorney general's office and police, the officers were accompanying a witness when they were ambushed. One gang member was also killed in the confrontation.

Combined police and military forces scoured the area looking for those responsible. A total of 15 police officers have been slain in El Salvador this year.