In Mat. 5:17, Jesus says:
Do not think that I have come to abolish the Law or the Prophets; I have not come to abolish them but to fulfill them.
By ‘Law’, Jesus is referring to the whole of the Law of Moses, including the Ten Commandments.
We know this is the case because Jesus goes on, in the rest of Mat. 5 and the Sermon on the Mount, to quote from various parts of the Law of Moses (not only from the Ten Commandments) and then give a fuller teaching on the passages. For example, in v38 Jesus quotes from Ex. 21:24, Lev 24:20 and/or Deut 19:21 and develops a teaching from it:
An eye for an eye and a tooth for a tooth.
This is from the Law of Moses, but isn’t one of the Ten Commandments (Ex. 20:1-17).
Jesus, in his teaching and in how he himself lived, fulfilled the whole of the Law of Moses. After all, the Law of Moses was just a ‘shadow’ of Christ (Col. 2:17; Heb. 8:5; 10:1): it hinted at Jesus, but Jesus is the reality.