Today the Army will formally end Operation Banner, the longest continuous deployment in UK military history, and will bring almost all the troops back home after almost four decades.
The move is a milestone for the Army and for Northern Ireland, which is now looking forward to a more peaceful era. The hope is that no more generations will grow up with heavily armed troops a familiar sight on the streets. The ending of the IRA campaign, and the widespread sense that the Troubles are over, mean that the Army will no longer be on active security duty, after 38 years which have seen more than 300,000 military personnel serve in Northern Ireland.
Some of them went through multiple tours of duty, but the campaign lasted so long that hardly anyone in the Army has served throughout its length.
For decades the phrases "British Army" and "streets of Belfast" have been almost synonymous, with newspapers and television carrying images of wary infantry trudging through dangerous urban and rural areas.
The troops were first called in in 1969 after a period of street marches degenerated into disorder. In Belfast, Protestant mobs set fire to Catholic homes in the Falls Road, while in Londonderry's Bogside, police were exhausted by days of nationalist rioting.
The Stormont government did not want to call them in, realising that their arrival would inevitably mean a loss of power for its Unionist government. And Westminster desperately resisted the move, for the instinct was strong "not to be drawn into the Irish bog".
It all happened under a previous generation of British Labour politicians: Harold Wilson, the Prime Minister, reluctantly approved their dispatch as an absolute last resort. He did so against the desire of the military establishment, a cabinet minister recording that the Defence Secretary, Denis Healey, "was cagey and said on no account must we risk having to take over".
But with rioting raging almost out of control, Stormont in desperation made an appeal for military aid to James Callaghan, the Home Secretary. Callaghan recalled being handed a message while flying in an RAF plane.
"It tersely informed us that an official request for the use of troops had been made. I immediately scribbled 'Permission granted' on the pad and handed it back to the navigator. A few minutes later General Freeland's troops began to relieve the police in the Bogside amid loud jubilation from the inhabitants."
That jubilation did not last long. Nationalists initially hailed the troops as saviours, handing out trays of tea and sandwiches to the first bemused squaddies.
But the military is a blunt instrument to come into contact with any civilian population, and the welcome dissipated as brushes on the streets produced friction leading to sustained rioting. The Army saw itself as providing protection to civilians and maintaining the peace. But in the nationalist ghettos, resentment grew with incidents such as a large-scale curfew in which a large part of the Falls Road was sealed off for several days.
Nationalist alienation from the military was heightened when troops were used in the disastrous introduction of internment without trial and, most of all, with Bloody Sunday in Londonderry in 1972. The deaths of 14 civilians who were taking part in a protest march put a final end to any military efforts to win nationalist hearts and minds. The event led to a swelling of the ranks of the IRA, and helped to spark off a major wave of violence, with almost 500 people killed that year.
This phase of the Troubles saw sustained gun battles which sometimes lasted for hours in the Belfast republican heartlands of the Falls and Ballymurphy. By that stage, it was apparent that the military presence, originally viewed as an emergency, short-term measure, would have to continue indefinitely.
In the years that followed, the Army never rebuilt relations with nationalists in general, but in addition it faced the Provisional IRA, which developed into a formidable terrorist grouping.
By the late 1970s the violence had reduced somewhat, yet by that stage the IRA had transformed itself into a smaller yet still deadly organisation with the ability to launch high-profile attacks and sustain a campaign.
The Army and police altered their strategy, with the police placed in overall charge but the military providing the back-up needed to contain the violence in frontline areas. Officers have often acknowledged that they faced a formidable foe in the IRA. One recently and inadvertently released army document described it as "what will probably be seen as one of the most effective terrorist organisations in history - professional, dedicated, highly skilled and resilient".
In the years that followed, the Army, alongside the police and other security services, remained locked in a long-running conflict with the IRA and lesser republican organisations.
Most of the Army's fatalities were suffered at the hands of the IRA. In one 1979 incident, 18 soldiers, 16 of them members of the Parachute Regiment, were killed in a two-stage IRA bombing attack at Warrenpoint, Co Down.
Soldiers were also vulnerable to snipers, and in some cases were killed while off duty. Over the years, the IRA used an array of tactics and weapons, including booby-trap bombs, mortars and machineguns.
The IRA menace increased in the late 1980s when it received shipments of high-grade weapons from Libya, including very powerful machineguns, rockets and even flamethrowers.
The organisation was particularly ingenious in putting to use Libyan-supplied Semtex in booby-trap bombs and other homemade but effective devices which posed a serious threat to military vehicles and bases. In the border region of South Armagh - known as "bandit country" - the threat was so high that almost all troop movements had to take place by helicopter, since local roads were too dangerous.
As the years passed, the Army developed new technology to protect its vehicles and the scores of military installations which were dotted all over Northern Ireland. New bases and watchtowers were built using sophisticated new techniques. The military also hit back aggressively at the IRA, imprisoning large numbers of its members. It used the SAS in a series of ambushes which intercepted IRA units en route to carry out bombings or shootings. The IRA's worst single loss came at Loughgall, Co Armagh, in 1987, when a concealed SAS team opened fire on an IRA unit intent on attacking a police station. Eight IRA members were shot dead.
A major complication during the Army's deployment lay in the threat posed by loyalist extremists. Although these were for the most part dealt with by the police, there were times when the Army struggled to contain large-scale demonstrations which threatened stability. In addition, sections of the Army also had an undercover role. Military intelligence infiltrated loyalist terrorist groups, placing or recruiting undercover agents within their ranks.
While this produced some significant breakthroughs, it was also to lead to major controversies, with accusations that intelligence officers had used agents not to save lives but to direct loyalist gunmen towards specific republican targets.
The 1989 murder of the Belfast solicitor Pat Finucane, who was killed by a loyalist organisation which included at least one agent planted in its ranks by army intelligence, is to be the subject of an official public inquiry.
The Army and the IRA meanwhile remained locked in battle into the 1990s. The IRA lost important figures, but remained a menace. In 1996, it set off two car bombs inside the Army's closely-guarded headquarters in Lisburn, Co Antrim, killing a warrant officer, in what was seen as a huge security breach.
The last soldier to be killed by the IRA, Lance-Bombardier Stephen Restorick, died in the following year, the victim of a sniper using a high-powered rifle.
The question of who really prevailed, the Army or the IRA, remains unanswered and will be the subject of controversy for years to come. The IRA has gone as an active force, having abandoned the idea of victory and instead pursuing its aims through politics. The Army would not claim to have beaten the IRA in the sense of bringing about its surrender, but it can argue that violence did not prevail and that the conflict ended with a political settlement.
Five Catholics are killed, 60 injured and hundreds of homes devastated after troops impose a curfew in the Falls Road area on 16 August GETTY IMAGES
Soldiers patrol the Bogside area of Londonderry after clashes between Catholics and Protestants
Bloody Sunday: Troops open fire on demonstrators in Londonderry, killing 14 civilians and injuring 17
Mourners mob the car containing Corporals David Howes and Derek Wood who are beaten, tortured and killed after they accidentally drive into the path of an IRA funeral
Soldiers erect barbed-wire barriers to try to stop loyalist demonstrators breaking through near Drumcree Church during the annual Orange Order parade PA
A boy aims a pretend gun at the first soldiers to go on foot patrol in west Belfast for 17 months, after the IRA bomb attack in London's Docklands
Soldiers return to the streets of Northern Ireland during the bloody feud between the Ulster Volunteer Force and the Ulster Freedom Fighters
Soldiers watch as families walk through a Protestant area to the Roman Catholic Holy Cross primary school in north Belfast after a night of sectarian rioting
Private Andrew Mason, right, of the 2nd Battalion The Prince of Wales Royal Regiment, closes the gate for the last time at Bessbrook Army base in South Armagh PETER MORRISON/APReuse content