THE DECISION
Whichever offence occurs first is penalised so the foul is only penalised if it occurs before the player in an offside position commits an offside offence (e.g. touched the ball). If both offences occur at the same time the foul is penalised as it is more serious i.e. offside is punished with an indirect free kick whereas the foul is punished with a direct free kick.
Read official Law 11 ↗