Article 99 [source]

Spanish Criminal Code
English translation

In cases where sentences and security measures involving deprivation of liberty are imposed concurrently, the judge or court shall order the enforcement of the security measure, which shall be credited towards the sentence. Once the security measure is lifted, the judge or court may, if the execution of the sentence would jeopardize the effects achieved through it, suspend the enforcement of the remainder of the sentence for a period not exceeding its duration, or apply one of the measures provided for in Article 96.3.