BOSTON — A member of the violent MS-13 gang has been sentenced to 13 years in federal prison after pleading guilty to a conspiracy charge involving a brutal stabbing.

Federal prosecutors say 22-year-old Daniel Menjivar was also sentenced Monday to three years of probation and faces deportation upon completion of his sentence. He pleaded guilty in September to conspiracy to conduct enterprise affairs through a pattern of racketeering activity, more commonly referred to as RICO conspiracy.

Prosecutors say Menjivar, a native of El Salvador living in Chelsea, and a gang associate repeatedly stabbed and shot a man they thought was a member of a rival gang in Chelsea in May 2014. He then openly boasted about the attack in an undercover recording.

The victim was stabbed 21 times, but survived.

Federal prosecutors believe MS-13, or the Mara Salvatrucha, has thousands of members across the country, mostly Central American immigrants.