With the west at peace, Iohannes II decided to attack the Danishmendids who held Kastamon. He marched there through Bithynia and Paphlagonia, besieged the city with scaling ladders and siege-engines and captured it, with little bloodshed. Its ruler (Gumushtegin Ghazi), in despair, was forced into exile. Ioannes captured other places, and crossed the Halys. All these feats were achieved while he was ill