Originally a reference to a violent group/cult in India but etymologically anglicized to refer to a brutal criminal in general for most of the latter 19th and 20th century. The word was adopted/co-opted by the American Rap and Hip Hop music scene in the late 20th century generally defining a tough anti-hero with criminal involvement.
Recently the white conservative movement in the U.S.A. has adopted it as a substantive replacement for the vulgar and toxic term "nigger" which is no longer safe for use in most media channels.
Livin' life thug style -- Tupac (To live and die in L.A. 1996
"Obama is an Indonesian Muslim turned welfare thug and a racist in chief'"(Mark Williams)