What if, in soccer, right after the attacking team scores a goal, the defending team makes a foul? Say, it was a corner, and the ball already crossed the line, and then a defending player slide-tackles a attacking person. What is the result? A penalty? Or maybe a direct free kick inside the goal?!?
As soon as the ball has wholly crossed the goal line (or touch line) whether on the ground or in the air, it is out of play. [Law 9] And, fouls are called only for offences which are committed by a player on the field of play while the ball is in play. [Interpretation of Law 12] (Cf. also Can a foul be overriden before it is taken?)
Therefore, the goal normally stands and the play will resume with a kick-off by the team conceding the goal as usual. [Law 12] However, the persons involved in the misconduct may be cautioned or sent off by the referee.
However, if another player of the attacking team has committed a foul before the ball has wholly crossed the goal line, the goal would not stand [Law 10], and the play would resume by a free kick by the defending team. (After possibly cautioning or sending off the offender(s).)
If a player of the defending team has committed a foul a moment before the ball has wholly crossed the goal line, the goal would stand by the referee applying an advantage. [Law 5] (Even though the referee can also caution or send off the offender(s).)
Laws of the Game and Interpretation of the Laws of the Game and Guidelines for Referees 2015/2016:
The ball is out of play when:
- it has wholly crossed the goal line or touch line whether on the ground or in the air […]
Interpretation of Law 12:
The following conditions must be met for an offence to be considered a foul:
it must be committed by a player
it must occur on the field of play
it must occur while the ball is in play
If the ball is out of play, play is restarted according to the previous decision
Law 10 (emphasis mine):
A goal is scored when the whole of the ball passes over the goal line, between the goalposts and under the crossbar, provided that no infringement of the Laws of the Game has been committed previously by the team scoring the goal
[The referee] allows play to continue when the team against which an offence has been committed will benefit from such an advantage and penalises the original offence if the anticipated advantage does not ensue at that time
If the ball has crossed the line legally before the foul is committed, the goal counts towards the attacking team. In this case, any tackle that occurs on an attacking player is late, and hence the player committing the foul is either cautioned(i.e., shown a yellow card) or sent off(i.e., shown a red card) depending on the severity of the foul. However the attacking team does not get a penalty or a free kick. The goal stands and play is resumed via a kick off from the centre spot by the team that conceded the goal(as is normal when a goal has been scored).
Even if the attacking team has caused an offence after the ball crosses into the goal, the goal stands and the referee then penalizes the player who committed the offence. Play then resumes via kick off. The only reason a goal would not stand even if ball has entered the goal, is if the attacking team has caused an offence before the ball crossed the goal line.
Even if the foul occurs before the ball has entered the goal, the referee will allow the goal to stand, and take appropriate action against the player committing the foul if required. This scenario falls under the purview of the Advantage Rule, where the referee is allowed to let play continue, even if a foul has occurred, if the team against whom the foul is caused has a sufficient advantage as deemed so by the referee.
FIFA Laws of the Game 2015/16 (italics my own to provide emphasis)
Powers and Duties
• allows play to continue when the team against which an offence has been committed will benefit from such an advantage and penalises the original offence if the anticipated advantage does not ensue at that time
The referee may play advantage whenever an infringement or offence occurs. The referee should consider the following circumstances in deciding whether to apply the advantage or stop play:
• the severity of the offence: if the infringement warrants an expulsion, the referee must stop play and send off the player unless there is a subsequent opportunity to score a goal
• the position where the offence was committed: the closer to the opponent’s goal, the more effective it can be
• the chances of an immediate, promising attack
• the atmosphere of the match
The decision to penalise the original offence must be taken within a few seconds.
If the offence warrants a caution, it must be issued at the next stoppage. However, unless there is a clear advantage, it is recommended that the referee stops play and cautions the player immediately. If the caution is NOT issued at the next stoppage, it cannot be shown later.
NOTE: I know the question asked was not exactly about the Advantage rule. I felt it was required to provide a little extra information for anyone else reading the answer.