By the early 1260s, Béla's relationship with his oldest son and heir, Stephen, became tense, which caused a
civil war lasting until 1266. After a brief conflict, Béla IV and his son divided the country and Stephen received the lands to the east of the
Danube in 1262. Panyit became a partisan of the duke, possibly because the majority of his possessions laid in the territory of Stephen's realm. Panyit's long-time rival was
Ernye Ákos, who also extended his influence in Borsod County in the previous decades and was considered a faithful supporter of Béla IV. The rivalry between the Ákos and Miskolc clans over the dominance in Borsod County characterized the second half of the 13th century. After the division of spheres of influence in the kingdom, Panyit tried to take advantage of the situation and acquired several lands in the county with the permission of Stephen. Ernye temporarily left his estates and his centre Dédes Castle and moved to Béla's realm to
Transdanubia. , erected by Panyit Miskolc The reconciliation of Stephen and his father was only temporary. The junior king seized and confiscated the domains of
his mother and sister,
Anna, which were located in the lands under his rule. Béla IV's army crossed the Danube under Anna's command sometime after the autumn of 1264, which marked the beginning of the civil war between father and son. Simultaneously with the main army, a detachment of the royal army, under the command of Béla's
Judge royal Lawrence, son of Kemény forced Duke Stephen to retreat as far as the fortress at
Feketehalom (Codlea, Romania) in the easternmost corner of
Transylvania. Based on two documents, historians Gyula Pauler and
Jenő Szűcs argued Panyit Miskolc arrived at the protracted siege with a rescue army and relieved the castle. However, in fact, the rescue army was led by
Peter Csák. The first document narrates that Panyit reconnoitered on the intentions of the besiegers and thus contributed to the victory, while the second says Panyit and some companions defeated the besiegers with "strength and cunning." Historian Attila Zsoldos argues Panyit was enlisted to the royal army by force during the early stage of civil war and he switched allegiance officially at the siege of Feketehalom. Because of the prolonged siege of Feketehalom (which, in fact, failed by then) royal general
Henry Kőszegi sent Ernye Ákos with an army of
Cuman warriors to
Tiszántúl, in order to support the besiegers and, later, to hinder Duke Stephen's counter-offensive. The battle took place somewhere west of
Várad (present-day Oradea, Romania) in February 1265. Ernye suffered a serious defeat and was himself captured by the enemy, Peter Csák's army. A document says that Ernye's rival Panyit Miskolc presented the fettered prisoner Ernye in the ducal court of Stephen following the battle. It is plausible that Panyit also participated in the
Battle of Isaszeg in March 1265, where Stephen's army won a decisive victory over the royal army. During the civil war in Hungary, Stephen's vassal,
Despot Jacob Svetoslav submitted himself to Tsar
Constantine Tikh of Bulgaria. In the summer of 1266, Stephen and Béla IV – who reconciled a few months earlier – jointly invaded
Bulgaria, seized
Vidin and other forts and routed the Bulgarians in five battles. Panyit participated in the war and was entrusted to lead an army which successfully besieged and occupied
Pleven, according to a royal charter from 1270. For his loyal service, Panyit was installed as
ispán of
Doboka County by Duke Stephen sometime around 1268. In that year, he was granted portions of villages
Mályi,
Kistokaj and a fishpond called Filtó, which had laid between
Szederkény and
Kisfalud. ==Baron of the realm==