When Musa passed away, the leadership of Children of Israel passed to Yusha ibn Nun (in English narration Joshua).
Yusha ibn Nun is not mentioned directly in the Quran by name but he is the servant of Moses who is referred to in the following verse:
Behold, Moses said to his attendant, "I will not give up until I reach the junction of the two seas or (until) I spend years and years in travel." (Quran 18:60)
The Prophet, (peace be upon him) mentions the name of Yusha ibn Nun as this servant of Moses in a number of authentic narrations – see for example 3:124 and 55:613 of Sahih Al-Bukhari. Being a servant of Moses, he was close to the Revelation, close to the teacher and he was a righteous student of this teacher.
Under the leadership of Yusha ibn Nun, Children of Israel is made victorious and returns to the Holy Land, an event which did not occur under Moses or Harun (who both passed away whilst Children of Israel were still in the wilderness). The Prophet gives us a clue as to why this victory was delayed when he said:
"None of the ones who worshipped the calf entered into Jerusalem."
The Children of Israel who came out of Egypt were raised up in slavery and servitude so they were weak and were not fit for victory. Allah made them stay in the wilderness for 40 years until all of that generation had passed away. And they were replaced by a new generation raised in freedom and taught the guidance of the Torah by Moses and Harun, and it was this generation that was given the victory.
Moses is undoubtedly the greatest Prophet that was sent to Children of Israel and he strived eagerly to have this victory, yet we see that victory was not at his hands but rather at Yusha's. What do we learn from this? That it is not enough to have an excellent leader alone – applying this to our times, it is not enough for us simply to wait for Al-Mahdi but rather we need to ensure we are a generation capable of victory and to be led to that victory by an excellent leader (be that Al-Mahdi or someone else).
(But) among (their) Allah- Fearing men were two on whom Allah had bestowed His grace: They said: "Assault them at the (proper) Gate: when once ye are in, victory will be yours; But on Allah put your trust if ye have faith." (Quran 5:23)
The Quran didn’t mention the two names but we know from hadith they were Yusha and Khaleb.
And through the example of Yusha we see how Allah grants victory to those who have prepared for it. Yusha ibn Nun led the Children of Israel against the Jababirah (the inhabitants of Jerusalem, Amorites), who were a large giant-like people. The fighting was furious and the sun was about to set. Yusha ibn Nun knew that he could not defeat these people except if the day was longer as, if night came, the Jababirah (Amorites) would be able to regroup.
The next day is Saturday (Shabbat) which starts with the sunset of Friday. If the sun goes down and Shabbat sets in, the fight cannot be continued and victory cannot be gained. So, Yusha pointed to the sun and said, "You are receiving orders and I am receiving orders from Allah, O Allah stop the sun!" Allah (SWT) caused the sun to stop for Yusha ibn Nun until he defeated the people of Jerusalem. If you have Allah on your side, don't worry! It's not a matter of numbers, or weapons, or artillery when Allah is on your side.The full story of Yusha ibn Nun is told to us in a sahih hadith of the Prophet (peace be upon him), recorded in Sahih Muslim 19:4327. The Prophet said:
"One of the Prophets made a holy war. He said to his followers: One who has married a woman and wants to consummate to his marriage but has not yet done so; another who has built a house but has not yet erected its roof; and another who has bought goats and pregnant she-camels and is waiting for their offspring-will not accompany me … "
This Prophet did not want any person to come with him whose heart may be attached to anything else. This is a Prophet who is not looking for numbers but rather for ikhlas (sincerity).
We know this Prophet was Yusha ibn Nun because of a separate narration recorded by Imam Ahmad in which the Prophet Mohammed (peace be upon him) said:
"The sun has never stopped for any man besides Yusha when he wanted to conquer Bayt alMuqaddis (Jerusalem)."
Yoshua won the battle. There was one more condition. Whoever enters the city must ask forgiveness:
And remember We said: "Enter this town, and eat of the plenty therein as ye wish; but enter the gate with humility, in posture and in words, and We shall forgive you your faults and increase (the portion of) those who do good." (Quran 2:58)
The word of forgiveness that had to be pronounced was: „Hitta”, حطة , but people mocked, losing their minds. They made fun of the words, instead of "Hitta" they said "Hinta" which means seed of a weed and anything else. Because of their mockery, Allah sent plague on them and many perished at the site. Only a few could enter Jerusalem.
By this time Harun and Moses were long dead. Also, those passed away who had wandered in the desert for 40 years. Yusha alone lived this time from that generation. He ruled over his people for another 27 years in the service of the One God with just. After his death, the Children of Israel were divided. A feud struck between them. Faith and rulership fell into separate hands for many decades. Faith and power were reunited much later in the hands of David, who, with his son Solomon, established the Kingdom of Israel, submitted to One God, and therefore can be classified as Muslim Kingdom from an Islamic point of view.
Why am I writing all this? Because our present days recall back the era of Yusha by the many betrayals of God.