Background: Microalbuminuria is an early sign of kidney disease in people with diabetes and indicates increased risk of cardiovascular disease. We tested whether a urinary proteomic risk classifier (CKD273) score was associated with development of microalbuminuria and whether progression to microalbuminuria could be prevented with the mineralocorticoid receptor antagonist spironolactone. Methods: In this multicentre, prospective, observational study with embedded randomised controlled trial (PRIORITY), we recruited people with type 2 diabetes, normal urinary albumin excretion, and preserved renal function from 15 specialist centres in ten European countries. All participants (observational cohort) were tested with the CKD273 classifier and classified as high risk (CKD273 classifier score >0·154) or low risk (≤0·154). Participants who were classified as high risk were entered into a randomised controlled trial and randomly assigned (1:1), by use of an interactive web-response system, to receive spironolactone 25 mg once daily or matched placebo (trial cohort). The primary endpoint was development of confirmed microalbuminuria in all individuals with available data (observational cohort). Secondary endpoints included reduction in incidence of microalbuminuria with spironolactone (trial cohort, intention-to-treat population) and association between CKD273 risk score and measures of impaired renal function based on estimated glomerular filtration rate (eGFR; observational cohort). Adverse events (particularly gynaecomastia and hyperkalaemia) and serious adverse events were recorded for the intention-to-treat population (trial cohort). This study is registered with the EU Clinical Trials Register (EudraCT 20120-004523-4) and ClinicalTrials.gov (NCT02040441) and is completed. Findings: Between March 25, 2014, and Sept 30, 2018, we enrolled and followed-up 1775 participants (observational cohort), 1559 (88%) of 1775 participants had a low-risk urinary proteomic pattern and 216 (12%) had a high-risk pattern, of whom 209 were included in the trial cohort and assigned to spironolactone (n=102) or placebo (n=107). The overall median follow-up time was 2·51 years (IQR 2·0–3·0). Progression to microalbuminuria was seen in 61 (28%) of 216 high-risk participants and 139 (9%) of 1559 low-risk participants (hazard ratio [HR] 2·48, 95% CI 1·80–3·42; p<0·0001, after adjustment for baseline variables of age, sex, HbA1c, systolic blood pressure, retinopathy, urine albumin-to-creatinine ratio [UACR], and eGFR). Development of impaired renal function (eGFR <60 mL/min per 1·73 m2) was seen in 48 (26%) of 184 high-risk participants and 119 (8%) of 1423 low-risk participants (HR 3·50; 95% CI 2·50–4·90, after adjustment for baseline variables). A 30% decrease in eGFR from baseline (post-hoc endpoint) was seen in 42 (19%) of 216 high-risk participants and 62 (4%) of 1559 low-risk participants (HR 5·15, 95% CI 3·41–7·76; p<0·0001, after adjustment for basline eGFR and UACR). In the intention-to-treat trial cohort, development of microalbuminuria was seen in 35 (33%) of 107 in the placebo group and 26 (25%) of 102 in the spironolactone group (HR 0·81, 95% CI 0·49–1·34; p=0·41). In the safety analysis (intention-to-treat trial cohort), events of plasma potassium concentrations of more than 5·5 mmol/L were seen in 13 (13%) of 102 participants in the spironolactone group and four (4%) of 107 participants in the placebo group, and gynaecomastia was seen in three (3%) participants in the spironolactone group and none in the placebo group. One patient died in the placebo group due to a cardiac event (considered possibly related to study drug) and one patient died in the spironolactone group due to cancer, deemed unrelated to study drug. Interpretation: In people with type 2 diabetes and normoalbuminuria, a high-risk score from the urinary proteomic classifier CKD273 was associated with an increased risk of progression to microalbuminuria over a median of 2·5 years, independent of clinical characteristics. However, spironolactone did not prevent progression to microalbuminuria in high-risk patients. Funding: European Union Seventh Framework Programme.