Defensive three-second violation

A defensive three-second violation, also known as illegal defense, is a basketball rules infraction in the National Basketball Association (NBA), which was added prior to the 2001–2002 season. It is assessed when a member of the defending team spends more than three seconds in the free throw lane (also called the key, the 16-foot lane, or "the paint") while not actively guarding an opponent. To be considered actively guarding an opponent, a defender must be within arm's length of an opponent and must be in a guarding position. A violation will not be called if an offensive player is in the act of shooting, if the offensive team loses control of the ball, if it is imminent that the defender's position will become legal, or if the defender is guarding a player who has possession of the ball.

The team committing a defensive three-second violation is assessed a team technical foul. The offense receives one free throw and retains possession of the ball.

The NBA also made zone defenses legal prior to the 2001–2002 season. However, the defensive three-second violation makes it difficult for NBA defenses to play zone, since zone defenses usually position a player in the middle of the key to stop penetration. The Philippine Basketball Association used to follow the illegal defense rule until the 2003 PBA season, when it was abolished.

The WNBA adopted its own defensive three-second rule in 2013.