Te lucis ante terminum (English: To Thee before the close of day) is an old Latin hymn in long metre. It is the hymn at Compline in the Roman Breviary.
The authorship of Ambrose of Milan, for which Pimont contends, is not admitted by the Benedictine editors or by Luigi Biraghi. The hymn is found in a hymnary in Irish script (described by Clemens Blume in his Cursus, etc.) of the eighth or early ninth century; but the classical prosody of its two stanzas (solita in the third line of the original text is the only exception) suggests a much earlier origin. In this hymnary it is assigned, together with the hymn Christe qui splendor et dies (also known as Christe qui lux es et dies), to Compline.
An earlier arrangement (as shown by the Rule of Caesarius of Arles, c. 502) coupled with the Christe qui lux the hymn Christe precamur adnue, and assigned both to the "twelfth hour" of the day for alternate recitation throughout the year. The later introduction of the Te lucis suggests a later origin.
The two hymns Te lucis and Christe qui lux did not maintain everywhere the same relative position; the latter was used in winter, the former in summer and on festivals; while many cathedrals and monasteries replaced the Te lucis by the Christe qui lux from the first Sunday of Lent to Passion Sunday or Holy Thursday, a custom followed by the Dominicans. The old Breviary of the Carthusians used the Christe qui lux throughout the year. The Roman Breviary assigns the Te lucis daily throughout the year, except from Holy Thursday to the Friday after Easter, inclusively. Merati, in his notes on Galvanus's Thesaurus, says that it has always held without variation this place in the Roman Church. As it is sung daily, the Vatican Antiphonary gives it many plainsong settings for the varieties of season and rite.