Empirical chemotherapy remains the standard of care in patients with unfavourable cancer of unknown primary (CUP). Gene-expression profiling assays have been developed to identify the tissue of origin in patients with CUP; however, their clinical benefit has not yet been demonstrated. We aimed to evaluate the efficacy and safety of site-specific therapy directed by a 90-gene expression assay compared with empirical chemotherapy in patients with CUP. This randomised controlled trial was conducted at Fudan University Shanghai Cancer Center (Shanghai, China). We enrolled patients aged 18-75 years, with previously untreated CUP (histologically confirmed metastatic adenocarcinoma, squamous cell carcinoma, poorly differentiated carcinoma, or poorly differentiated neoplasms) and an Eastern Cooperative Oncology Group (ECOG) performance status of 0-2, who were not amenable to local radical treatment. Patients were randomly assigned (1:1) by the Pocock and Simon minimisation method to receive either site-specific therapy or empirical chemotherapy (taxane [175 mg/m2 by intravenous infusion on day 1] plus platinum [cisplatin 75 mg/m2 or carboplatin area under the curve 5 by intravenous infusion on day 1], or gemcitabine [1000 mg/m2 by intravenous infusion on days 1 and 8] plus platinum [same as above]). The minimisation factors were ECOG performance status and the extent of the disease. Clinicians and patients were not masked to interventions. The tumour origin in the site-specific therapy group was predicted by the 90-gene expression assay and treatments were administered accordingly. The primary endpoint was progression-free survival in the intention-to-treat population. The trial has been completed and the analysis is final. This study is registered with ClinicalTrials.gov (NCT03278600). Between Sept 18, 2017, and March 18, 2021, 182 patients (105 [58%] male, 77 [42%] female) were randomly assigned to receive site-specific therapy (n=91) or empirical chemotherapy (n=91). The five most commonly predicted tissues of origin in the site-specific therapy group were gastro-oesophagus (14 [15%]), lung (12 [13%]), ovary (11 [12%]), cervix (11 [12%]), and breast (nine [10%]). At the data cutoff date (April 30, 2023), median follow-up was 33·3 months (IQR 30·4-51·0) for the site-specific therapy group and 30·9 months (27·6-35·5) for the empirical chemotherapy group. Median progression-free survival was significantly longer with site-specific therapy than with empirical chemotherapy (9·6 months [95% CI 8·4-11·9] vs 6·6 months [5·5-7·9]; unadjusted hazard ratio 0·68 [95% CI 0·49-0·93]; p=0·017). Among the 167 patients who started planned treatment, 46 (56%) of 82 patients in the site-specific therapy group and 52 (61%) of 85 patients in the empirical chemotherapy group had grade 3 or worse treatment-related adverse events; the most frequent of these in the site-specific therapy and empirical chemotherapy groups were decreased neutrophil count (36 [44%] vs 42 [49%]), decreased white blood cell count (17 [21%] vs 26 [31%]), and anaemia (ten [12%] vs nine [11%]). Treatment-related serious adverse events were reported in five (6%) patients in the site-specific therapy group and two (2%) in the empirical chemotherapy group. No treatment-related deaths were observed. This single-centre randomised trial showed that site-specific therapy guided by the 90-gene expression assay could improve progression-free survival compared with empirical chemotherapy among patients with previously untreated CUP. Site-specific prediction by the 90-gene expression assay might provide more disease information and expand the therapeutic armamentarium in these patients. Clinical Research Plan of Shanghai Hospital Development Center, Program for Shanghai Outstanding Academic Leader, and Shanghai Anticancer Association SOAR PROJECT. For the Chinese translation of the abstract see Supplementary Materials section.