Objective. To investigate the value of contrast-enhanced ultrasound (CEUS) in transthoracic biopsy of peripheral lung and mediastinal lesions. Methods. Of 142 patients, 82 patients received CEUS before biopsy and were defined as CEUS group. The remaining 60 patients only underwent conventional ultrasound (US) before biopsy and were served as US group. The information of CEUS was used for selecting indication and instructing biopsy. The imaging features, number of punctures, diagnostic successful rate, and complication rate between the two groups were compared. Results. Necrosis was demonstrated in 43.9% of the lesions in CEUS group and in 6.7% of US group (P < 0.001). Detection rate of lesion hidden in pulmonary atelectasis in CEUS group was 13.4%, which was statistically higher than 1.7% of US group (P = 0.013). The diagnostic success rate was 96.3% for CEUS group and 80% for US group, respectively (P = 0.002). The average number of punctures was 2.5 ± 0.7 and 2.6 ± 0.6, respectively. There was no significant difference in complications between CEUS group and US group. Conclusions. CEUS could play an important role in selecting proper indication and improving diagnostic accuracy rate of lung biopsy.