O you who have believed, do not make allies of a people with whom Allāh has become angry. They have despaired of [reward in] the Hereafter just as the disbelievers have despaired of [meeting] the companions [i.e., inhabitants] of the graves.
Since the Sūrah commenced with a warning against becoming allies with Allah’s enemies, it ends with a warning against the same to reiterate what was said previously. Allah said: O you who have faith in Allah, and who act on what He has ordained for you, do not take as allies a people with whom Allah is angry. They do not have conviction in the afterlife. Instead they despair of it just like their despair of the return of their dead to them, because they reject resurrection.