Outcome of a game in case of an illegal checkmate Suppose that, in an amateur rapid play tournament (where supervision is inappropriate), the following position appears:

[fen &quot;5K2/8/1q6/1N1k4/8/8/8/2R1R3 w - - 1 1&quot;]

1. Re5+? Qc5+? {illegal} 2. Rxc5#

The players do not agree on the result of the game. White claims he won in virtue of the rule:

5.1.a.
The game is won by the player who has checkmated his opponent’s king. This immediately ends the game, provided that the move producing the checkmate position was in accordance with Article 3 and Articles 4.2 – 4.7.

Black claims the game is a draw in virtue of the rule:

Appendix A.4.d.
If the arbiter observes both kings are in check, or a pawn on the rank furthest from its starting position, he shall wait until the next move is completed. Then, if the illegal position is still on the board, he shall declare the game drawn.

Remark that the position after 2.Rxc5# is indeed illegal in virtue of the rule:

3.10.c.
A position is illegal when it cannot have been reached by any series of legal moves.

The referee remarks that there is a discussion about a game, moves to this table and listens to both claims. What is the correct decision?
A related question: suppose that the referee remarks the illegal position after 1.... Qc5+, and stays near this table, and assists to the move 2.Rxc5#  What is the correct decision in this case?
The mate stands and white wins. Although the position both before and after the mating move is illegal the mating move itself is legal therefore article 5.1.a is satisfied. 

If an arbiter observes black playing 1...Qc5 then they declare the game lost for black for playing an illegal move. If they do not see the move but they observe the position after 1...Qc5 they will wait for white's move. Since white played 2.Rxc5 both kings are no longer in check hence article A.4.d does not trigger. In fact the purpose of the arbiter having to wait one move is to give the player a chance to correct the position. As it happens in this example the final position is still illegal but for a reason not covered by article A.4.d.