The construction of the building started in 1787. Almost immediately, however, the Russian state ran low on funds as a result of expenditures in connection with the ongoing Russo-Turkish War. As a result, the province became indebted to Stenbock, and the unfinished building passed into his possession. Jakob Pontus Stenbock used it as his Tallinn residence, and the building still bears its his remembrance. After Stenbock's death in 1828, the building passed between different owners until 1899, when it finally became the property of the Governorate administration and at last actually began to be used as a courthouse.[citation needed]
During both the first period of independence of Estonia (1919-1940) and during the Soviet occupation (to 1991) it continued to be used as a courthouse. The maintenance of the building was, however, gravely neglected during the Soviet years; among other things, the ceilings of two courtrooms and the archive of the court collapsed. When the Estonian Government assumed ownership in the early 1990s, the whole building was in risk of collapse. A complete renovation was carried out between