1982 Harmak incident refers to the accidental infiltration of Iranian territory during the Soviet–Afghan War, in which Soviet forces strayed from the target of a Mujahideen base in southern Afghanistan and accidentally destroyed an asphalt factory in Iran.
Background.
By 1982, the Soviet–Afghan War had been raging on for two years, and seemingly wasn't close to an end. The Soviets were in the control of major population centres while the rural areas were mostly under Mujahideen control.
Planning.
In March 1982, the Soviets decided to destroy a vital supply base at the village of Robat Jaali in southern Afghanistan just a few kilometres from the Pakistan-Afghanistan-Iran tripoint, given the nickname of "The Bermuda Triangle" by the Soviets. According to Soviet intelligence, this was a vital Mujahideen base with about 60 militants and huge cache of weapons and ammunition. The operation was planned in Moscow, and to maintain operational secrecy the Soviet military did not inform either the Afghan Army or KHAD as both had many Mujahideen informants.
The operation was commanded by General Anatoly Tabunshchikov, who in an Antonov command plane would follow the main strike force and do a photo evaluation of the raid, while the forces themselves would be led by Colonel Vladimir Aprelkin. The plan was complicated as the target was at a large distance and Soviet helicopters couldn't reach the target without refueling. Ultimately it was decided that a force of 600 Soviet troops, including Spetsnaz special forces, would assemble about 50 kilometres from Robat Jaali for refueling on 4 April. The next morning, the target would be bombed by about 12 Su-17s followed by 60 Mi-8 who would capture the target along with all its supplies. Then after six hours they would be refueled and return to base.
Incident.
The operation did not go as planned. Just as the helicopters flew from their base for refueling point, they faced a severe sandstorm causing them to split into small groups, each of which had to reach the point on its own with the last groups reaching at night.
On the morning of 5 April, the strike force departed from the refueling point for the target, with Colonel Aprelkin as a passenger in the frontal helicopter. At the specified time, two Su-17s dropped parachute flares to mark the location of the target and the other Su-17s successfully bombed the target.
However, some flares were released too high, and a strong wind blew them off course by several kilometres and they landed on the Iranian side of the border.
After the arrival of the strike force, the leading helicopter crew who been there earlier told Colonel Aprelkin that they were not on their target location, but the commander, Colonel Aprelkin disagreed and stated that the strike force had not yet arrived at the target location. He ordered the pilot to keep flying towards the flares and the rest of the strike group followed.
After some time they came across a road with a civilian bus driving on it but no such roads were on the Soviet map. Colonel Aprelkin was again informed but now the Colonel saw some buildings and he was convinced that it was their target of Robat Jaali. He issued an order to the force to engage.
The lead helicopter landed at the purported target and soon others in the strike force also landed. In about twenty minutes, the Soviet soldiers came out of their helicopters and captured the compound which was guarded by only two civilian guards.
The Soviets soon realised it wasn't their target but an ordinary civilian asphalt factory which was closed on that day. 
At the same time, General Tabunshchikov who came for damage assessment saw the situation and informed Colonel Aprelkin over radio that the strike force had crossed the Iranian border and landed near the town of Harmak. General Tabunshchikov ordered the strike force to evacuate immediately. He informed his superiors telling them, "Our troops are on foreign territory!"
Iranian response.
Two F-4 Phantom II fighters from the Iranian Air Force arrived and opened fire on the landed Mi-8s, they were followed by two more F-4s. The Soviet MiG-23s had been ordered by the General not to engage. "It was bad enough that we had attacked the Iranian town," Tabunshchikov said, "and there was no need to escalate the problem by shooting down Iranian airplanes over Iran." The Iranian F-4s managed to destroy two Mi-8s.
By that time a group of Iranian Army tanks approached and started firing, the Soviets were again ordered not to engage; the Iranians retook the factory. The Soviets hastily retreated, leaving some personnel behind who they were forced to walk the three hours back to the Afghan border.
Aftermath.
Mujahideen became aware of the Soviet failure and were able to evacuate their base before the Soviet raid. The, Iranian government filed diplomatic protests with the Soviet Union. Soviet officials issued a formal statement accepting responsibility for the mistake and compensation was paid. The official Soviet inquiry put the blame on Colonel Aprelkin for inaccurate navigating and unauthorised attack. He was demoted but remained as a commander in Afghanistan.
References.
 ;templatestyles src="Reflist/styles.css" / ;