user19248: I was playing with my brother, and we both had equal number of pieces.
He carelessly moved his king in the direction of my queen. I was about to checkmate my brother, but he told that my mating move was invalid.  If his king comes in my direction and gets caught, I must say that I don't keep there.  
I was confused. Can anyone please help me?

user3495: There is a special case where you can reply to an illegal move with checkmate. In blitz chess different sets of rules exist. I have played blitz tournaments over the board where if you leave your king in check [so you have made an illegal move] the other player can "take" your king which is checkmate and they win the game. It's surprising how often that does happen. It's worth adding that the otehr player must make a move that "takes" your king. If they do not then you could make a legal move by getting your king out of check and the game goes on. In other words the player cannot just claim checkmate; they must make the legal move that captures the king. 

user4418: Moving your king into check (i.e. where it can be captured) is called an "illegal move".
If you are playing a casual game then you should put the position back to what it was before the illegal move was made and make a legal move.
If you are playing in a competition then more formal rules apply as specified in the sections of the FIDE Laws of Chess from article 6 onwards.
In a competition you play with clocks and the illegal move only counts as "completed" if you pressed the clock after making the illegal move. If you have not pressed the clock then you should just take the move back, play a legal move with the touched piece if possible and continue the game.
If you have completed the move by pressing the clock then you must also take the move back and play a legal move with the piece touched if possible but then additional penalties apply. These are spelled out in article 7.5.5:

7.5.5 After the action taken under Article 7.5.1, 7.5.2, 7.5.3 or 7.5.4 for the first completed illegal move by a player, the arbiter shall give two minutes extra time to his opponent; for the second
  completed illegal move by the same player the arbiter shall declare
  the game lost by this player. However, the game is drawn if the
  position is such that the opponent cannot checkmate the player’s king
  by any possible series of legal moves.

These rules apply for all competition chess regardless of time control. Regardless of whether it is standard, rapid or blitz a second illegal move loses the game.
The only difference between standard time controls on one hand and blitz and rapid on the other is in determining that an illegal move has been made. In standard the moves are recorded and it is possible to detect an illegal move several moves later and also to return to the position before the illegal move. In the two quicker forms where moves are not recorded (world championships may differ in the respect that moves are recorded and so standard rules apply) and so slightly different rules apply regarding detecting that an illegal move has been made.
These are spelled out in Appendix A.4.2:

A.4.2 If the arbiter observes an action taken under Article 7.5.1, 7.5.2, 7.5.3 or 7.5.4, he shall act according to Article 7.5.5, provided the opponent has not made his next move. If the arbiter does
  not intervene, the opponent is entitled to claim, provided the
  opponent has not made his next move. If the opponent does not claim
  and the arbiter does not intervene, the illegal move shall stand and
  the game shall continue. Once the opponent has made his next move, an
  illegal move cannot be corrected unless this is agreed by the players
  without intervention of the arbiter.

So, in rapid and blitz the illegal move must be spotted immediately. If any more moves are made then the illegal move stands and the game continues. If the move is spotted by either the opponent or the arbiter then the normal rules apply and a second illegal move loses the game unless it is impossible for the opponent to mate.

user12873: If by "get caught" you mean the king moves such that it can be taken in one move, then yes you don't win the game. You must allow your opponent to take the move back. In official tournaments this would be counted as an "illegal move", and after 2 illegal moves from your opponent you win the game.
A checkmate is where you move a piece such that your opponent's king is trapped and attacked at the same time. It's not where your opponent's king steps into a direct attack on its own.

user18809: Yes. Putting your own king into danger is considered an illegal move. Depending on the context, illegal moves can be treated in different ways:

In most casual games, players just agree to roll back to the position before the illegal move was made.
In tournament games, the player who didn't make the illegal move gets 2 extra minutes on the clock. I guess this does not apply, as most likely you aren't playing with a chess clock. Anyway, the second illegal move is punished with a loss

Since you're playing a casual game with your brother, just go for the one you agree on!

19248: <p>I was playing with my brother, and we both had equal number of pieces.
He carelessly moved his king in the direction of my queen. I was about to checkmate my brother, but he told that my mating move was invalid.  If his king comes in my direction and gets caught, I must say that I don't keep there.  </p>

<p>I was confused. Can anyone please help me?</p>
 3495: <p>There is a special case where you can reply to an illegal move with checkmate. In blitz chess different sets of rules exist. I have played blitz tournaments over the board where if you leave your king in check [so you have made an illegal move] the other player can "take" your king which is checkmate and they win the game. It's surprising how often that does happen. It's worth adding that the otehr player must make a move that "takes" your king. If they do not then you could make a legal move by getting your king out of check and the game goes on. In other words the player cannot just claim checkmate; they must make the legal move that captures the king. </p>
 4418: <p>Moving your king into check (i.e. where it can be captured) is called an "illegal move".</p>

<p>If you are playing a casual game then you should put the position back to what it was before the illegal move was made and make a legal move.</p>

<p>If you are playing in a competition then more formal rules apply as specified in the sections of the <a href="https://www.fide.com/fide/handbook.html?id=208&amp;view=article" rel="nofollow noreferrer">FIDE Laws of Chess</a> from article 6 onwards.</p>

<p>In a competition you play with clocks and the illegal move only counts as "completed" if you pressed the clock after making the illegal move. If you have not pressed the clock then you should just take the move back, play a legal move with the touched piece if possible and continue the game.</p>

<p>If you have completed the move by pressing the clock then you must also take the move back and play a legal move with the piece touched if possible but then additional penalties apply. These are spelled out in article 7.5.5:</p>

<blockquote>
  <p><strong>7.5.5</strong> After the action taken under Article 7.5.1, 7.5.2, 7.5.3 or 7.5.4 for the first completed illegal move by a player, the arbiter shall give two minutes extra time to his opponent; for the second
  completed illegal move by the same player the arbiter shall declare
  the game lost by this player. However, the game is drawn if the
  position is such that the opponent cannot checkmate the player’s king
  by any possible series of legal moves.</p>
</blockquote>

<p>These rules apply for all competition chess regardless of time control. Regardless of whether it is standard, rapid or blitz a second illegal move loses the game.</p>

<p>The only difference between standard time controls on one hand and blitz and rapid on the other is in determining that an illegal move has been made. In standard the moves are recorded and it is possible to detect an illegal move several moves later and also to return to the position before the illegal move. In the two quicker forms where moves are not recorded (world championships may differ in the respect that moves are recorded and so standard rules apply) and so slightly different rules apply regarding detecting that an illegal move has been made.</p>

<p>These are spelled out in Appendix A.4.2:</p>

<blockquote>
  <p><strong>A.4.2</strong> If the arbiter observes an action taken under Article 7.5.1, 7.5.2, 7.5.3 or 7.5.4, he shall act according to <strong>Article 7.5.5</strong>, provided the opponent has not made his next move. If the arbiter does
  not intervene, the opponent is entitled to claim, provided the
  opponent has not made his next move. If the opponent does not claim
  and the arbiter does not intervene, the illegal move shall stand and
  the game shall continue. Once the opponent has made his next move, an
  illegal move cannot be corrected unless this is agreed by the players
  without intervention of the arbiter.</p>
</blockquote>

<p>So, in rapid and blitz the illegal move must be spotted immediately. If any more moves are made then the illegal move stands and the game continues. If the move is spotted by either the opponent or the arbiter then the normal rules apply and a second illegal move loses the game unless it is impossible for the opponent to mate.</p>
 12873: <p>If by "get caught" you mean the king moves such that it can be taken in one move, then yes you don't win the game. You must allow your opponent to take the move back. In official tournaments this would be counted as an "illegal move", and after 2 illegal moves from your opponent you win the game.</p>

<p>A checkmate is where you move a piece such that your opponent's king is trapped and attacked at the same time. It's not where your opponent's king steps into a direct attack on its own.</p>
 18809: <p>Yes. Putting your own king into danger is considered an illegal move. Depending on the context, illegal moves can be treated in different ways:</p>

<ul>
<li>In most casual games, players just agree to roll back to the position before the illegal move was made.</li>
<li>In tournament games, the player who didn't make the illegal move gets 2 extra minutes on the clock. I guess this does not apply, as most likely you aren't playing with a chess clock. Anyway, the second illegal move is punished with a loss</li>
</ul>

<p>Since you're playing a casual game with your brother, just go for the one you agree on!</p>
