Turkish President Recep Tayyip Erdogan has come under criticism for telling a small girl dressed in a military uniform that she would be honored if she were "martyred" for Turkey.

Erdogan spotted the weeping-and-saluting 6-year-old Amine Tiras while delivering a speech at his ruling party's congress in the city of Kahramanmaras, and had her brought on stage.

After trying to comfort her, Erdogan told the crowd: "She has the Turkish flag in her pocket. If she becomes a martyr, God willing, this flag will be draped on her."

Some people were appalled and took to Twitter to criticize the president.

His action comes as nationalist sentiment is running high over a Turkish cross-border military offensive against Syrian Kurdish fighters that are affiliated with Kurdish rebels fighting inside Turkey.