You are given a sentence in Portuguese. Your job is to translate the Portuguese sentence into Spanish.

Lembrou-se de ter prometido a Deus, quase a morrer, em 2001, que, se sobrevivesse, serviria a humanidade para sempre.

Show your work and conclude with the exact phrasing "Therefore, the final answer is [answer]." where [answer] is just the final number or expression that solves the problem.
user
Recordó su promesa a Dios, mientras agonizaba en el 2001, si vivía, serviría a la humanidad el resto de sus días.