Near the end of the Four Years War between the Klingon Empire and the United Federation of Planets, from reference stardate 1/9409.29 to 1/9806.13, with Klingon forces suffering against Starfleet, Admiral Komex came to believe that the war was hurting the Empire, those under his command, and himself. If Starfleet decimated the Empire, then it would be a great loss of status for himself and all Klingons. He felt the war had to be stopped now, so that the Klingons would still be strong enough to fight the next war against the Federation. Against that, he cared little for what would happen to himself afterwards.
Thus on stardate 1/9712.06, Komex surrendered himself to Federation authorities and betrayed the locations and importance of two major Klingon supply bases in the disputed area, including Kolm-an. This led to Starfleet victory at the Battle of Kolm-an and the Klingons sued for peace, as Komex predicted they would. After the war's conclusion, Komex refused an offer of asylum in the Federation and returned to Klinzhai in a prisoner exchange program. To the Federation, he was never heard from again, while the Klingons never acknowledged his existence to them. The Federation presumed him to have been executed in disgrace.
In fact, Komex formally presented himself to Emperor Karhammur for judgment, thus redeeming the honor of his linename. He was executed in single combat by Kassa, Karhammur's heir. However, his defense that he'd acted to end a war that was harming the Empire's ability to rebuild found agreement amongst several influential lines, and Karhammur was soon forced to abdicate in favor of Kassa. By tradition, Komex never lost his previously earned status. (FASA RPG - The Klingons modules: The Klingons: Star Fleet Intelligence Manual, The Klingons: Game Operations Manual; FASA RPG module: The Four Years War)