A confusion about the fullfilment of the law Jesus said in Mat 5:17-18:


  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. For truly I tell
  you, until heaven and earth disappear, not the smallest letter, not
  the least stroke of a pen, will by any means disappear from the Law
  until everything is accomplished.


If we stop reading the paragraph at the former bolded sentence, we'll get the impression that the law is eternal (well... until heaven and earth disappear). But if we keep reading until reaching the latter bolded text, we'll get a different understanding: somehow the law will end after "everything is accomplished" (Christ's earthly duties are done?). So it's not eternal, after all.

Isn't this a contradiction? I'm still having a hard time understanding this passage.
As @curiousdanni pointed out in comments, the text here does not put forth the eternality of the Law and Prophets but rather highlights two conditions in which they may or will pass away:  If the current created order passes away or if everything in them is fulfilled.  It is possible that these two are to be understood as concurrent but that is not necessary.

Jesus said that he came for the purpose of fulfilling the Law and the Prophets, some of which has been accomplished and some of which is still yet to be.  Paul makes it clear that the Law's purpose as a means for obtaining righteousness has been brought to an end.  This is not a terminal end but an objective end;  Jesus is the righteousness that the Law was intended to produce.  "For Christ is the end of the law for righteousness to everyone who believes." - Romans 10-4  Also, the epistle to the Hebrews is filled with elements of the tabernacle and sacrificial system that typified and were fulfilled in Christ (Hebrews chapter 9).  In 1 Corinthians 10:4 Christ is pointed out as the spiritual rock the Israelites drank from in the desert and there are many more such examples.  The Messiah was also prophesied to need to come and to suffer and to enter into glory (Isaiah 53 and Luke 24:26 among many others).  So, there are a great many aspects of the Law and Prophets which have already been fulfilled in the birth, life, death, burial, resurrection, and ascension of Jesus into heaven as well as the giving of the Holy Spirit (Joel 2:28) and the inauguration of the Church (Hosea 2:23).

But the Law and Prophets are not yet passed away.   "Do we then overthrow the law by this faith? By no means! On the contrary, we uphold the law." - Romans 3:31  We do not set the Law aside because "the law is holy, and the commandment is holy and righteous and good." - Romans 7:12  What has ended regarding the Law is that it is no longer the means by which righteousness may be obtained.  Christ has met every requirement of the Law for us in that regard; he has kept the Law in a positive sense, not only in letter but in spirit and he has borne the curse of the Law for us as well so that, through faith, we are now able to fulfill the righteousness that the Law required: "For God has done what the law, weakened by the flesh, could not do. By sending his own Son in the likeness of sinful flesh and for sin, he condemned sin in the flesh,  in order that the righteous requirement of the law might be fulfilled in us, who walk not according to the flesh but according to the Spirit." - Romans 8:3-4  This is why Paul speaks so harshly against those who claim that he taught a flaunting of the Law (Romans 3:8)

And there are many prophesies yet to be fulfilled regarding the second coming of Christ (Zechariah 12:10), the resurrection (Job 19:26), the permanent settling of God's people in the Land (Ezekiel 36), the creation of a new heaven and earth (Revelation 21) to name just a few.

In summary, God's Word is said to never pass away even if heaven and earth do pass away (Matthew 24:35) but the Law and Prophets, having been given for specific and limited purpose do have an expiration date that has yet to be reached.  It is also certain that these will ultimately be totally fulfilled by Christ "For all the promises of God find their Yes in him. That is why it is through him that we utter our Amen to God for his glory." - 1 Corinthians 1:20

"so shall my word (Christ) be that goes out from my mouth;
    it shall not return to me empty,
but it shall accomplish that which I purpose,
    and shall succeed in the thing for which I sent it." - Isaiah 55:11