Attack of opportunity

An attack of opportunity (AOO) is a single extra melee attack that is automatically taken when an enemy makes themselves vulnerable, such as moving in combat (see also Tumble or Spring Attack) or casting a spell.

Tip
Taking an AOO will cancel other actions, such as casting a spell. One way spellcasters avoid them is to carry a ranged weapon, since AOOs are only taken for melee.