Stalemating the opponent in order to not lose There are some defensive ideas to get one's own king stalemated in order to not lose the game (mostly in the endgame, but sometimes also in the middle game).


Have (master) games been played where the only idea not to lose was to stalemate the opponent?
What about any legal position (which need not have occurred in a real game)?
What if you forget about the "only idea" requirement?


Edit: Although there is already a totally fine answer, I would not mind more answers using another patterns.
It's possible to build a bit on magd's answer. Consider the following position.

 [Title "White to move"] 
 [SetUp "1"]
 [FEN "8/8/8/8/8/1N6/pk1K4/8 w - - 0 1"]

 1. Na1! Kxa1 2. Kc1


The only way to draw is 1. Na1! Kxa1 2.Kc1 (or 2. Kc2) stalemate. I think there are some nice studies with this theme, but I can't find them right now.