Is a person who is
      killed in a war against the communists considered to be a shaheed
      (martyr)?
Question

                Sometimes there are
      clashes and battles between the Thai army – which includes a number of
      Muslims – and Communist groups in different parts of XXXX. This results
      in deaths on both sides. What is the ruling on the Muslims who are
      fighting in the ranks of the XXX army and are killed fighting these
      Communist gangs? Can we consider them to be martyrs (shuhadaa’)?
Praise be to Allah.Their
      matter rests with Allaah, Who knows what their intentions were. The
      Prophet 
 (peace and blessings of Allaah be upon him) was asked about
      one who fights because he is brave, one who fights for the sake of
      tribalism or nationalism, and one who fights in order to show off –
      which one is fighting for the sake of Allaah? He said: “The one who
      fights so that the word of Allaah will be supreme is the one who is
      fighting for the sake of Allaah.” (Agreed
      upon. Al-Bukhaari, 1/40; Muslim, 2/1513).
On
      this basis, the one who was fighting for the sake of Allaah and so that
      the word of Allaah will be supreme is considered to be a martyr.
 And
      Allaah is the source of strength. May Allaah bless our Prophet Muhammad
      and his family and companions, and grant them peace.