The pluperfect

The Spanish pluperfect—as well as the past anterior—resembles the English past perfect because it describes an action or situation that happened and ended in the past prior to another past action or situation, but unlike the past anterior, it is not limited by immediacy. The pluperfect is formed by using the preterit of the verb haber + the past participle of the verb that describes the action or state.

Se molestó porque el vuelo de su novió ya había partido cuando llegó al aeropuerto.