We present a measurement of the spatial clustering of massive compact galaxies at 1.2 ≤ z ≤ 3 in CANDELS/3D-HST fields. We obtain the correlation length for compact quiescent galaxies (cQGs) at z ∼ 1.6 of and compact star forming galaxies (cSFGs) at z ∼ 2.5 of assuming a power-law slope γ=1.8. The characteristic dark matter halo masses MH of cQGs at z ∼ 1.6 and cSFGs at z ∼ 2.5 are i26" class="mathmlsrc">i26.gif&_user=111111111&_pii=S138410761630077X&_rdoc=1&_issn=13841076&md5=d2a3efedaaf2cf8abd42d1f8eb24bae4">i26.gif"> and respectively. Our clustering result suggests that cQGs at z ∼ 1.6 are possibly the progenitors of local luminous ETGs and the descendants of cSFGs and SMGs at z > 2. Thus an evolutionary connection involving SMGs, cSFGs, QSOs, cQGs and local luminous ETGs has been indicated by our clustering result.