Man you really lucked out in that one. Black had so many chances to win including the position before the last move. If he plays Ka3 instead, he will queen and the game will be over. I commend you though for not resigning and playing it out which helps in the process of learning and gives you a chance to pull out a lucky game as you did here.
My longest game ever 2010
This game is longer
That's because most of the moves in the endgame are not effecting and their just moving them back and fourth through the game.
http://www.chess.com/livechess/game.html?id=43399306 Here's the link to it, it takes too long to make a moving diagram.