late 14c., from sun (n.) + set (v.). Perhaps from a Middle English subjunctive such as before the sun set. Old English had sunnansetlgong "sunset," while sunset meant "west." Figurative use from c. 1600. To ride off into the sunset (1963) is from the stereotypical ending of cowboy movies.