There are two types of flagrant fouls in the NBA: a flagrant "1" (FFP1) which is defined as "unnecessary contact committed by a player against an opponent" and flagrant "2" (FFP2) which is "unnecessary and excessive contact committed by a player against an opponent. The former results in two free throws for the opposing team and possession while the latter similarly gives the opposing team two shots from the line but also includes automatic ejection of the player committing the foul.
Any player who is called for two flagrant “1” fouls in the same game will be automatically ejected from that game.