Prešporok, today Bratislava) and Detrekő (Slovak Plavecké Podhradie), Matthew managed to reoccupy the castles on behalf of the king. Henceforward, the Danube became the border between the developing domains of the Kőszegi and Csák families. King Andrew appointed him to master of the horse and he also became the ispán (comes) of Pozsony County (1293–1297). On 28 October 1293, Matthew issued a charter and promised that he would respect the liberties of the burghers of the city of Pozsony that King Andrew had confirmed before. During this period, Matthew started to augment his possessions not only by the king's donations, but also by using force. In 1296, he bought Vöröskő (Slovak: Červený Kameň) from its former holders for money; however, contemporary documents prove that he enforced several neighboring landowners to transfer their possessions either to him or his partisans. He even was ready to occupy territories; e.g., around 1296, he took possession of the lands of the Archabbot of Pannonhalma south of the Danube and he also trespassed the possessions of the Collegiate Chapter of Pressburg. Around the end of 1296, Matthew acquired Trencsén (Slovak: Trenčín) and afterwards, he was named after the castle. In 1296 King Andrew appointed him Palatine, but shortly afterwards the king absolved one of Matthew's opponents, Andrew of Gimes from the Hont-Pázmány clan of all responsibility for the damage he had caused to Matthew. The document proves that the relationship of the king and Matthew worsened and the king deprived him of his office of Palatine in 1297. At the same time, the king granted Pozsony County to his queen, Agnes of Austria. Kings' rival Matthew continued to style himself Palatine even after 1297. He managed to overcome Andrew of Gimes and his family and thus expanded his influence along the Zsitva River (Žitava River). In 1298, King Andrew III allied himself with King Wenceslaus II of Bohemia; the alliance was probably directed against Matthew whose possessions lay between the two monarchs' territories. In the next year, King Andrew sent his troops against him, but he could resist the attack; only Pozsony County was reoccupied by the king's partisans. Before 1300, Matthew entered into negotiations with the representatives of King Charles II of Naples and reassured him that he would assist the claim of his grandson, Charles for the throne against King Andrew III. However, in the summer of 1300, Matthew visited Andrew's court, but