Is this legal?

Back move king next to white king to mate. Is this allowed? Isn't it king suicide?