He first responded to the Pecheneg invasion deviously, by sending Pecheneg-speaking envoys to talk and divide them with bribes, since they were fragmented into tribes and military units. Those chiefs he won over were treated very generously. He attacked the rest immediately near Beroe, while they were uncertain whether to accept his bribes. The battle was terrible, as the Romans could not withdraw without disaster, while the Pechenegs fought bravely, with cavalry charges and arrows, forming their wagons into a defensible circle like a city wall, leaving lines for counter-attack. Ioannes II himself, relying on the icon of the Theotokos and accompanied by his axe-wielding guards, broke the circle of wagons, and then won a hand-to-hand battle, with terrible casualties, especially among the Pechenegs, many of whom were also taken prisoner. Ioannes was wounded in the foot. His brother, the sebastokrator Andronikos, played a crucial role in the victory. These captives were settled along the borders (in settlements still known to Kinnamos and Choniates) or taken into the army. Ioannes won a great triumph (still celebrated later as the festival of the Pechenegs)