Little is known about the association between common mental disorders (CMD) and labor market integration among refugee and Swedish-born young adults. Socially disadvantaged patients such as refugees are more likely to discontinue their medication use prematurely. This study aimed to identify clusters of individuals with similar psychotropic medication patterns; and examine the relationship between cluster membership with labor market marginalization (LMM) in refugee and Swedish-born young adults with CMD. The study uses a longitudinal matched cohort aged 18-24 years with CMD diagnoses from Swedish registers covering 2006–2016. Dispensed psychotropic medications (antidepressants, antipsychotics, anxiolytics, sedative-hypnotics, mood stabilizers) were collected one year before and after CMD diagnosis. Clusters of patients with similar time courses of prescribed dosages were algorithmically identified. The association of cluster membership with subsequent LMM, (long-term sickness absence, SA, disability pension, DP, or long-term unemployment, UE) was assessed using Cox regression. Among 12,472 young adults with CMD, there were 13.9% with SA, 11.9% with DP, and 13.0% with UE during a mean follow-up of 4.1 years (SD 2.3 years). Six clusters of individuals were identified. A cluster with a sustained increase in all medication types yielded the highest hazard ratio (HR [95% CI]) 1.69 [1.34, 2.13] for SA and 2.63 [2.05, 3.38] for DP. The highest HRs of UE give a cluster with a concentrated peak in antidepressants at CMD diagnosis (HR 1.61[1.18, 2.18]). Refugees and Swedish-born showed similar associations between clusters and LMM. To prevent LMM, targeted support and early assessment of CMD treatment are needed for individuals with a sustained increase in psychotropic medication after CMD diagnosis and for refugees in high-risk clusters for UE characterized by a rapid lowering of treatment dosages, which could be an indicator for premature medication discontinuation.