The Iggerot Moshe (Helek Bet Hoshen Mishpat 47) writes that if you have a bug, and it bothers you, you may kill, but preferably not by hand. He says there is no ISUR. Since there is no problem in killing a bug, I would assume since Saar Bale Hayim Deorayta, I would assume that you should kill him.
EDIT: I asked a big Talmid Hacham, and he said according to the Peshat (simple explanation) it is Mutar, and according to the Ari it is not permitted (I understand if it's talking about a situation where he is not in pain).
EDIT: The Mishna Berura siman 533 writes that on Hol HaMoed one may kill a bug.
Also HaRav Moshe Sternbuch (Teshuvot WeHanagot vol. 2 siman 756) that there is no Isur (if it is bother you- just like the Igerot Moshe).