Daniel tells you when this decree was given. Context is critical to understand this. All the following is quoted from Young's Literal Translation.
What started Daniel's conversation with Gabriel?
In the first year of Darius, son of Ahasuerus, of the seed of the Medes, who hath been made king over the kingdom of the Chaldeans,
in the first year of his reign, I, Daniel, have understood by books the number of the years, in that a word of Jehovah hath been unto Jeremiah the prophet, concerning the fulfilling of the wastes of Jerusalem – seventy years;
Daniel was reading Jeremiah 25:9-13 where it says the same thing it says here - God sentenced the land of Judah to destruction for 70 years.
Afterward Daniel was moved to pray, and what does he pray about for 16 verses?
and I set my face unto the Lord God, to seek by prayer and supplications, with fasting, and sackcloth, and ashes.
And I pray to Jehovah my God, and confess, and say: ‘I beseech Thee, O Lord God, the great and the fearful, keeping the covenant and the kindness to those loving Him, and to those keeping His commands;
we have sinned, and done perversely, and done wickedly, and rebelled, to turn aside from Thy commands, and from Thy judgments:
and we have not hearkened unto Thy servants the prophets, who have spoken in Thy name unto our kings, our heads, and our fathers, and to all the people of the land.
‘To Thee, O Lord, is the righteousness, and to us the shame of face, as at this day, to the men of Judah, and to the inhabitants of Jerusalem, and to all Israel, who are near, and who are far off, in all the lands whither Thou hast driven them, in their trespass that they have trespassed against Thee.
‘O Lord, to us is shame of face, to our kings, to our heads, and to our fathers, in that we have sinned against Thee.
‘To the Lord our God are the mercies and the forgivenesses, for we have rebelled against Him,
and have not hearkened to the voice of Jehovah our God, to walk in His laws, that He hath set before us by the hand of His servants the prophets;
and all Israel have transgressed Thy law, to turn aside so as not to hearken to Thy voice; and poured on us in the execration, and the oath, that is written in the law of Moses, servant of God, because we have sinned against Him.
‘And He confirmeth His words that He hath spoken against us, and against our judges who have judged us, to bring in upon us great evil, in that it hath not been done under the whole heaven as it hath been done in Jerusalem,
as it is written in the law of Moses, all this evil hath come upon us, and we have not appeased the face of Jehovah our God to turn back from our iniquities, and to act wisely in Thy truth.
And Jehovah doth watch for the evil, and bringeth it upon us, for righteous is Jehovah our God concerning all His works that He hath done, and we have not hearkened to His voice.
And now, O Lord our God, who hast brought forth Thy people from the land of Egypt by a strong hand, and dost make for Thee a name as at this day, we have sinned, we have done wickedly.
Pay extra attention to this part:
‘O Lord, according to all Thy righteous acts, let turn back, I pray Thee, Thine anger and Thy fury from Thy city Jerusalem, Thy holy mount, for by our sins, and by the iniquities of our fathers, Jerusalem and Thy people are for a reproach to all our neighbours;
and now, hearken, O our God, unto the prayer of Thy servant, and unto his supplication, and cause Thy face to shine on Thy sanctuary that is desolate, for the Lord’s sake.
‘Incline, O my God, Thine ear, and hear, open Thine eyes and see our desolations, and the city on which Thy name is called; for not for our righteous acts are we causing our supplications to fall before Thee, but for Thy mercies that are many.
O lord, hear, O Lord, forgive; O Lord, attend and do; do not delay, for Thine own sake, O my God, for Thy name is called on Thy city, and on Thy people.’
Daniel started this chapter reading Jeremiah’s prophecy about the destruction of Jerusalem and how long before the destruction would end. Daniel then prayed to God about the destruction of Jerusalem and begged him to bring the destruction to an end. And then what happened?
And while I am speaking, and praying, and confessing my sin, and the sin of my people Israel, and causing my supplication to fall before Jehovah my God, for the holy mount of my God,
yea, while I am speaking in prayer, then that one Gabriel, whom I had seen in vision at the commencement, being caused to fly swiftly, is coming unto me at the time of the evening present.
And he giveth understanding, and speaketh with me, and saith, ‘O Daniel, now I have come forth to cause thee to consider understanding wisely;
at the commencement of thy supplications [again, what was Daniel praying about?] hath the word come forth, and I have come to declare it, for thou art greatly desired, and understand thou concerning the matter, and consider concerning the appearance.
weeks [sevens] are determined for thy people, and for thy holy city, to shut up the transgression, and to seal up sins, and to cover inquity, and to bring in everlasting judgment [ancient justice], and to seal up vision and prophet and to anoint the holy of holies.
Here is an excerpt from Gesenius Lexicon that shows the "everlasting judgment" should be "ancient justice". Notice he says it has to have this meaning - and then he says it can't have this meaning.
And that bring us to the verse you asked about - Daniel 9:25 (the edits are mine):
And thou dost know, and dost consider wisely, from the going forth of the word to restore and to build Jerusalem till
Messiah the Leader [anointed prince] is seven weeks [sevens], and sixty and two weeks [sevens]: the broad place hath been built again, and the rampart, even in the distress of the times.
There is such a strong tradition saying that this must refer to Jesus Christ that even Robert Young did not translate this literally in his literal translation. For instance, the word "Messiah" only shows up in these two verses (Daniel 9:25-26) and Psalms 2. (In King James, the word Messiah is only used in Daniel 9-25-26.) Everywhere else that Hebrew word (משיח) appears, Young translated that word into "anointed". He should have done that here too.
Also, there is no definite article - no "the" (in Hebrew, no ה) - in that phrase. It should just be "anointed leader" or "anointed prince", not "the anointed leader/prince".
In addition, Gabriel said the 7 sevens was "from the going forth of the word to restore and rebuild Jerusalem" to the anointed leader. Which word was Gabriel referring to? The same word that started this scenario.
Read Daniel 9:2 again:
in the first year of his reign, I, Daniel, have understood by books the number of the years, in that a word of Jehovah hath been unto Jeremiah the prophet, concerning the fulfilling of the wastes of Jerusalem -- seventy years;
The same Hebrew word (דבר) is translated into "word" in verse 2 and 25.
Daniel tells you when this word went forth. It went forth when Jerusalem was destroyed! There would be 70 years between when Jerusalem was destroyed and then rebuilt, but 7 sevens into it - or 49 years into it - an anointed leader would come on the scene. Who was that?
Isaiah 44:26-28, 45:1
Confirming the word of His servant, The counsel of His messengers it perfecteth, Who is saying of Jerusalem, She is inhabited, And of cities of Judah, They shall be built, and her wastes I raise up,
Who is saying to the deep, Be dry, and thy rivers I cause to dry up,
Who is saying of Cyrus, My shepherd, And all my delight He doth perfect, So as to say of Jerusalem, Thou art built, And of the temple, Thou art founded.
Thus said Jehovah, To His anointed, to Cyrus, Whose right hand I have laid hold on, To subdue nations before him, Yea, loins of kings I loose, To open before him two-leaved doors, Yea, gates are not shut:
Jerusalem was destroyed by the Babylonians around 585 BC. Cyrus took power around 536 BC. That is a 49 year difference. And it was in the first year of his reign that he decreed the Jews could return to their land.
And in the first year of Cyrus king of Persia, at the completion of the word of Jehovah in the mouth of Jeremiah, hath Jehovah waked up the spirit of Cyrus king of Persia, and he causeth an intimation to pass over into all his kingdom, and also in writing, saying,
'Thus said Cyrus king of Persia, All kingdoms of the earth hath Jehovah, God of the heavens, given to me, and He hath laid a charge on me to build to Him a house in Jerusalem, that is in Judah; who is among you of all His people? Jehovah his God is with him, and he doth go up.'
Also Ezra 1:1-4:
And in the first year of Cyrus king of Persia, at the completion of the word of Jehovah from the mouth of Jeremiah, hath Jehovah waked up the spirit of Cyrus king of Persia, and he causeth an intimation to pass over into all his kingdom, and also in writing, saying,
'Thus said Cyrus king of Persia, All kingdoms of the earth hath Jehovah, God of the heavens, given to me, and He hath laid a charge on me to build to Him a house in Jerusalem, that is in Judah;
who is among you of all His people? His God is with him, and he doth go up to Jerusalem, that is in Judah, and build the house of Jehovah, God of Israel -- He is God -- that is in Jerusalem.
'And every one who is left, of any of the places where he is a sojourner, assist him do the men of his place with silver, and with gold, and with goods, and with beasts, along with a free-will offering for the house of God, that is in Jerusalem.'
After this period of 7 sevens (49 years), there would be another period of 62 sevens (434 years) in which the broad place (plaza) and the walls/moat would be rebuilt. Josephus says Pompey had a hard time filling in the moat to conquer Jerusalem and take the temple because of its immense size. Strabo says the moat was 60 feet deep and 250 feet wide. The city walls and the moat around the walls were huge. It would have taken some time to finish them, especially with all the political turmoil that nation had to deal with in that interval.
If this paragraph breaks the rules for this site we can take it out, but
I realize a lot of people who read this might have a hard time agreeing with this because, like Gesenius, they have a very ingrained belief that this passage must refer to Jesus Christ. If you are one of those people (I was one of those people), consider all the places in the New Testament where Matthew, Mark, Luke, John, Peter, and Paul highlight a prophecy that Jesus Christ fulfilled. Those men expend a great deal of effort to prove that He fulfilled even small details like riding the donkey and identifying the city He was born in, but never - not once - do any of them ever point to how Daniel 9 applies to Jesus Christ. My answer does not say Jesus Christ is not the Messiah - the Anointed. My answer does say the anointed leader mentioned in Daniel 9 refers a different anointed person (Cyrus).