Qisas

Qisas or Qiṣāṣ () is a term interpreted to mean "retaliation in kind", "eye for an eye", or retributive justice. 
Qisas was a practice used as a resolution tool in inter-tribal conflicts in pre-Islamic Arab society. The basis of this practice was that a member of the tribe to which the murderer belonged was handed over to the victim's family for execution, equivalent to the social status of the murdered person. The condition of "social equivalence" meant the execution of a member of the murderer's tribe who was equivalent to the murdered, in that the murdered person was male or female, slave or free, elite or commonplace. For example, only one slave can be killed for a slave, and a woman can be killed for a woman. On this pre-islamic understandings the discussion "whether a Muslim could be executed for a non-Muslim" was added in Islamic period.
In historical practice, qisas appears in two forms. One of them is, the punishment of the perpetrator "with the same act" in crimes "committed against the physical integrity of the person, such as a life for a life, an eye for an eye, a tooth for a tooth". Another application is related to the social status of the perpetrator and the victim. In the tribal understanding, when a person kills a woman, a slave or an honorable person from another tribe, a person "of similar status from the tribe to which the murderer belongs" will be killed in return. As a general custom, killing the master's to slave, father's to child, husband's to wife was not punished with retaliation, and retaliation was not applied to the man who killed the woman as a rule. The condition of "social equality" in qisas means that; "if a socially inferior person kills someone from the upper class, qisas will be applied", whereas "if someone from the upper class kills someone from the lower class, it cannot be applied". 
In this case, compensation can be paid to the family of the murdered person.
The main verse for implementation in Islam is Al Baqara; 178 verse;
": "'Believers! Retaliation is ordained for you regarding the people who were killed. Free versus free, captive versus captive, woman versus woman. Whoever is forgiven by the brother of the slain for a price, let him abide by the custom and pay the price well."
In traditional Islamic law ("sharia"), the doctrine of qisas allows a punishment analogous to the crime. Qisas is available to the victim or victim's heirs against a person convicted of murder or intentional bodily injury. In the case of murder, qisas gives the right to take the life of the killer, if the latter is convicted and the court approves. Those who are entitled to "qisas" have the option of receiving monetary compensation ("diyya") or granting pardon to the person instead.