PurposeThis study aims to examine the prevalence of transfer pricing and earnings management activities, and how they are impacted by corporate governance mechanisms.Design/methodology/approachUsing the political cost theory, the study provides insights into how opportunistic managerial behaviours which have a strong link to profit shifting and tax evasion are driven by corporate governance using data from 16 listed firms for the period 2008–2020.FindingsThe results reveal that the transaction-based transfer pricing model is better than the index-based model and the accrual-based earnings management model suits the political cost theory more than the real earnings management metric. Board size and female CEO increase transfer pricing aggressiveness but board independence, CEO tenure, CEO nationality and female Board Chairwomanship reduce transfer pricing aggressiveness. The findings also reveal the role of multinational enterprise status, private ownership, industry type, firm size, financial leverage, asset tangibility and firm age. For accrual-based earnings management, board independence, CEO tenure, and female Board Chairwomanship significantly decrease earnings management. Other factors include private ownership, firm size, and firm age.Practical implicationsThe findings of the study are relevant for shaping industry-level policies on earning management, transfer pricing and related-party transactions. Since these opportunistic managerial behaviours are the foremost drivers of tax avoidance and profit shifting, the findings of this study provide relevant insights for practitioners, tax and other regulatory authorities, policymakers and the academic community alike.Originality/valueThis is among the premier studies on the transfer pricing and earnings management nexus with corporate governance factors using the political cost theory, especially in the developing country context. It also reveals the significant impact of gender and suggests the need for gender diversity in corporate management.