when ... arrived
Cuando llegó la policía los ladrones ya se habían ido de la casa.
By the time the police arrived, the thieves had already left the house.
When he arrived I made coffee.
Cuando llegó Marcus yo dormía.
When Marcus arrived I was asleep.
Estaba viendo la televisión cuando llegó Tomás.
I was watching television when Tomás arrived.
Sí, Joan, pero tan sólo un momento cuando llegó hace pocos minutos.
Yes, Joan, but only for a moment, since he arrived a few minutes ago.
— Impacto (1981)
Tom y Mary estaban a punto de irse cuando llegó John.
Tom and Mary were about to leave when John arrived.