This study explores the application of the concept of siyasah qadhaiyyah in resolving disputes over Building Use Rights Certificates (SHGB) at the Medan State Administrative Court, highlighting how substantial justice interacts with formal legal principles in the context of land law in Indonesia. The background of this study is based on the complexity of land administration and the high frequency of disputes, which often show overlapping rights and ambiguous regulations. This study is urgent as a response to the need for integration between formal and substantial justice in judicial practice to create a more just and efficient legal system. The normative juridical method is used in this study, with a case approach to the PTUN Decision Number 131/G/PTUN.MDN. Primary data comes from the decision, while secondary data is obtained from relevant literature, helping to explore the principles of siyasah qadhaiyyah and mashlahah upheld by Imam al-Mawardi. The results of the study show that the court succeeded in integrating substantial justice with formal legal provisions, considering social and economic aspects in its decisions. The discussion underlines the importance of legal policies that do not only rely on formal legality but also on the social benefits and disad-vantages of legal decisions. The conclusion of this study emphasizes that the success of the courts in implementing siyasah qadhaiyyah and mashlahah provides an example of the importance of adapting the law to social dynamics and community needs, recommending increasing the capacity of judges in non-legal aspects and utilizing technology to increase transparency in land admin-istration. This study contributes to the development of legal theory and practice that supports social harmony and the welfare of the wider community.