The origin of the canonical hours of the Divine Office,
as they are recited daily in the Church, either publicly by chapters of canons or monks or privately by priests and clerics in major orders,
dates backto the days of the primitive Church.
Anciently, a vigil, or all-night watch service, preceded every Sunday.
This consisted of evening, night, and early morning prayers and was bound up with the idea that Christ at His second coming might arrive on such an eve and the faithful were desirous of being found watching and praying to receive Him.
By the fourth century this Sunday vigil had become a daily observance,
though it no longer lasted throughout the night.
Again, some of the faithful, and especially monks of the Benedictine observance, began to meet for pious exercises at each of the hours
which divided the day into its principal sections,
at the third, sixth, and ninth hours.
Later, the remaining two canonical hours Prime and Compline,
were introduced from monastic sources.
So, we have a divine office of three groups of prayers:
(1) the nocturnal group, represented today by the hours known as Vespers, Matins, and Lauds;
(2) the day hours, now called Terce, Sext, and None;
(3) a form of morning prayer called Prime and of evening prayer known as Compline.