Answer :

it is exclamotory word
We feel sad about some thing, that happened.  Some bad thing happened. So we express our sorrow, and grief.    It is an exclamation  remark.

There was a cyclone Hudhud which destroyed Visakhapatnam.  Alas! the people had to suffer for the next three days.