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.