Spain has just won the FIFA World Cup 1-0 in a match against Argentina that ran down to the wire.

During extra time, it looked as though Ferran Torres had scored a goal that would have brought Spain's lead to 2 and sealed a victory.

It was the second goal disallowed for Spain, this time for offside.

So what is the offside rule?

It's an infamous question asked by millions of football newbies every tournament.

If you've jumped on the World Cup bandwagon and found yourself trying to wrap your head around this section of the rule book, we're here to help.

Here's a quick breakdown of the rule.

Why does it exist?

The offside rule aims to prevent players from lingering next to the opponent's net to wait for a pass.

It forces teams to build up play carefully and use complex tactics to score goals.

Without the rule, teams would be incentivised to constantly launch long balls, making the game less dynamic.

So how does it work?

If a player is called for an offside offence, the referee will stop the play and award an indirect free kick to the opposing team.

The free kick is taken from the spot where the offside player had been located when their teammate passed them the ball.

A free kick is when a player on one team does something wrong and the referee gives the other team a chance to kick the ball while play has stopped.

A penalty is essentially the same thing, except the kick is taken inside the penalty box, which is directly in front of the goal, and opposing players aren't allowed to interfere until after the shot is taken.

Goals can be scored from either a free kick or a penalty kick, but they are more easily achieved from penalties.

When is a player offside?

A player is in an offside position if:

- they're standing in their opponent's half; and

- they're nearer to the goal than both the ball and the last line of defenders at the exact moment the ball is passed to them by a teammate.

However, an offside player is only penalised if they become involved in play.

And there's no offside offence if a player receives the ball directly from an opposition player, a goal kick, a throw-in or a corner kick.