This is the Khan al-Jumruk (the Customs Khan), constructed in 1608/9 under Murat Paşa. Two rebuildings left it with 6 domes instead of the original 9. For part of the nineteenth century this was where the customs house was located, hence its name.
The khan continues around a corner.