This verse was one of the last verses revealed. It refers to the expedition of Tabuk (Ibn Juzayy, Ibn Kathir, Tabari, al-Zamakhshari, and Ma’riful Quran by Mufti Shafi’i).
For further information why the expedition of Tabuk took place, please read the following article: “Answering Jihad: ‘Fight Against Those Who Do Not Believe’ – Quran 9:29“.
“O you who have believed, fight those adjacent to you of the disbelievers and let them find in you harshness. And know that Allah is with the righteous.” – Quran 9:123
9:123 – The verse gives details on who to confront – that are near to the Muslims. Those who are hostile and are at front to cause harm to the believers. The verse states that the fighting should be waged against those hostile enemies who are near to the Muslims. ‘Being near’, may mean, could be taken in terms of the place, that is, the enemies who live nearer to where the Muslims resided, 1400 years ago. That they should be fought against first so to eliminate the threat.
Just to be clear, nowhere in this verse does it give permission to kill innocents. The Prophet (p) in his life-time only fought those who were aiming to harm him and his people. That is the only time he fought back. Prophet Muhammed (p) states:
“O God! Let us enjoy our hearing, our sight and our power as long as you keep us alive and make our heirs from our own offspring, and make our revenge RESTRICTED TO THOSE WHO OPPRESS US, and support us AGAINST THOSE WHO ARE HOSTILE TO US let no misfortune afflict our Deen: let not worldly affairs be our principal concern, or the ultimate limit of our knowledge, and let not those rule over us who do not show mercy to us. (Riyad as-Salihin Book 5. Hadith 834)
And the Quran,
“God does not forbid you, with regard to those who do not fight you on account of your religion nor drive you out of your homes, to treat them with goodness and to be just to them; truly, God loves those who are just.” – Quran 60:8
Dr. Muhammad Asad:
“163 I.e., uncompromising with regard to ethical principles. For the general circumstances in which war is permitted, see 2:190-194, 22:39, 60:8-9, and the corresponding notes, as well as notes 7 and 9 on verse 5 of this surah. The reference to “those deniers of the truth who are near you” may arise from the fact that only “those who are near” can be dangerous in a physical sense or, alternatively, that – having come from afar – they have already approached the Muslim country with an aggressive intent.” 
Maulana Muhammad Ali:
“122a. The introduction here of the subject of the study of religion shows the aim which the Qur’an has in view. In the midst of the ordinances relating to fighting, it introduces the subject of the preparation of a missionary force, thus showing that this was the greatest necessity of Islam. It was only by means of a missionary effort that truth could be spread, and the ultimate object was not to be lost sight of, even when the community was engaged in a life-and-death struggle against overwhelming forces of the enemy.
123a. Because it was they who persecuted the Muslims. The object was to stop persecutions.
123b. So that you do not yield to them.” 
Malik Ghulam Farid:
“1224. As weakness in faith and in doing good works results from lack of true knowledge and training, the verse speaks of the way in which such weakness could be removed. The Arabs of the desert were quite ignorant of the teachings of Islam (9:97). The verse suggests a practical method of instructing them in the tenets and principles of the Faith.
1125. Refers to those hypocrites who lived among Muslims and mixed with them, Muslims were enjoined to fight them as a class and not each and every one of them individually, and to fight them by EXPOSING THEIR MALPRACTICES AND HYPOCRITICAL DEEDS BY BRINGING THESE TO THE NOTICE OF THE HOLY PROPHET.” 
Don’t forget to follow Discover The Truth on Facebook and Twitter. PLEASE help spread the word by sharing our articles on your favourite social networks.
 The Message of The Quran translated and explained by Muhammad Asad, page 411 – 412
 The Holy Quran Arabic Text with English Translation, Commentary and comprehensive Introduction [Year 2002 Edition] by Maulana Muhammad Ali page 429
 The Holy Qur’an – Arabic Text With English Translation & Short Commentary By Malik Ghulam Farid, Page 404