The Te Deum is the great Latin hymn of thanksgiving, sung at coronations, at the conclusion of councils, at victories and at the end of Matins, and its traditional authorship is a legend with a known shape.
The story, current from the eighth century, is that Ambrose baptised Augustine at Milan in 387 and that the two men composed the hymn on the spot, alternating verses under inspiration. It is a good story and it is not attested by either man, neither of whom mentions the hymn, and Augustine wrote at length about his own baptism.
The attribution now generally preferred is to Niceta of Remesiana, a bishop in what is now Serbia, active around 400. The case rests on manuscript ascriptions, several early manuscripts name him, and on stylistic and structural arguments. It is not certain, and other candidates have been proposed, including Hilary of Poitiers and an anonymous compiler.
The hymn's structure is worth noticing because it explains why it feels like two texts. The first portion is a doxology, praising God and the Trinity in language that echoes the Sanctus. The second turns to Christ specifically. The third is a series of verses drawn almost entirely from the Psalms, in a different register, and many scholars regard it as a later addition, a set of versicles that became attached and then fixed.
So the hymn as sung may be a composite of two or three pieces of different origin, which is a common enough history for a liturgical text and is invisible in performance.