“And this gospel of the kingdom will be preached in all the world as a witness to all the nations, and then the end will come.”
As we saw in Mark 16:15, Jesus Christ commissioned His Church to preach the good news of the Kingdom of God in all the world. Here in Matthew 24:14 Jesus gives a prophecy of the effects of that preaching in the end time just before His return to save humanity from self-destruction (Matthew 24:21-22).
“A witness” here can mean “testimony” or “a declaration of facts” and is from the Greek word marturion (Vine’s Complete Expository Dictionary of Old and New Testament Words, “witness”). The word is neutral—it can include both giving a message of hope and a message of warning. “The Gospel will bring either salvation or a curse, depending on how it is received” (Zondervan NIV Bible Commentary, Vol. 2, note on Matthew 24:14).
The “end” Jesus referred to is the end of this evil age of human misrule. When it ends, something much better will come in its place—the peaceful, utopian Kingdom of God.