From Vulgar Latin *eccum ille, from eccum (“behold him”) + ille (“that”), from Old Latin olle. Cognates include Italian quello (“that”) and Spanish aquel (“that”).
quellu