His target was Johnny "Mad Dog" Adair. His aim was to start a war in Scotland. Wannabe terror assassin Antoin Duffy failed on both counts.

The 39-year-old's conspiracy to kill Adair, a one-time unionist hard-liner now exiled in Ayrshire, was foiled by Scottish police and UK security services.

Had he succeeded in in 2013 plot, Duffy would have brought Irish Republican violence to Scotland for the first time fully 15 years after the Good Friday Agreement ended the Troubles.

And he would have done so in the hope of igniting tit-for-tat killings just as this country prepared entered the final year of independence referendum campaigning.

Police and MI5 stopped Duffy and his band of dissident Republicans and Scottish gangland sympathisers before a bullet was fired or bomb exploded. Law enforcement sources don't know how or if violent unionists would have responded to an attack. But they do know that the threat of violence was real.

Duffy and his co-conspirators had sourced weapons, including a fully operational Type 56 assault rifle, a Chinese version of the old but reliable Kalashnikov AK-47.

Any use of this gun, found by police next to a vacuum cleaner and a stored Christmas tree in a cupboard in a Paisley flat, would have been a declaration of war in itself. Firing an automatic weapon in Scotland would have been a clear statement of intent. Duffy and his friends even had a name for the Type 56.

They called it the "Big Fella" and they were saving it to use on Adair while a revolver and a sawn-off shotgun were obtained to deal with former UDA/Ulster Freedom Fighters figure now in Scotland, Mad Dog's right-hand-man, Sam McCrory.

The big picture: Duffy believed Sinn Fein and the IRA had sold out at Good Friday in 1998. He thought mainstream Republican leaders Gerry Adams and Martin McGuiness were traitors to their cause.

Disowned by the IRA and dissident groups like the Real IRA, he decided to target Adair and McCrory, formerly prominent in the UFF because he believed they had murdered innocent Irish Catholics in Northern Ireland.

His plot - police and intelligence services believe - was hatched when Duffy, was in Castle Huntly open prison in Perthshire. What he did not know was that MI5 was already on to him. So when he met contacts, or phoned or texted them, looking for guns, he was being bugged by the intelligence services.

His words were chilling. In a one bugged conversation he was heard boasting to his girlfriend Stacey McAllister: "I'm trying to get a war started and get as many guns and explosives as I can."

Duffy enlisted his cousin Martin Hughes as his right hand man and recruited fellow prisoner Ayr man Paul Sands a Facebook friend of Mr McCrory who knew about McCrory's daily routine.

Duffy is heard to say to co-accused Hughes during a bugged conversation: "We can stand with the best of them in history. This is the f***ing bastard that killed 50 of our people."

Hughes replied: "Have to get him before he gets ours."

Duffy's flat in Glasgow was bugged. So was Hughes' car, which was trailed by undercover police.

The paperwork for this surveillance operation was so secretive that there is no signature on it. The document on MI5 headed notepaper has a number where the signature would normally be.

Sources would not say how MI5 came to know what Duffy was plotting, or came to apply for authorisation to bug him.

The surveillance began in December 12, 2012, but when MI5's authorisation period ended they handed the operation over to Police Scotland and no MI5 operatives gave evidence during the ten week trial of Duffy, Hughes and Sands at the High Court in Glasgow.

Duffy and Hughes were also secretly bugged as they drove in Hughes' Mercedes Jeep from Glasgow to the Ayrshire home of former UDA and UFF boss Sam Skelly McCrory, on October 1, 2013.

They met up with Sands in Ayrshire and he directed them to right outside McCrory's house. This was a recce. They were, sources believe, planning on hitting McCrory first, with the shotgun and the revolver as back up.

Their theory? That the crime would be low profile with such weapons, allowing them to make a statement hit on Adair with an automatic later.

In bugged conversations, Sands said: "There are so many places you could hit this guy. It's unbelievable. I mean I could go and and chap his door right now and we could probably put him in the boot if three of us could manage it, know what I mean."

Duffy then said: "A sawn-off and a revolver as the back up."

As the Jeep approaches the street in which McCrory lives, Sands is heard to say: "This is the road he walks every single day. You can't go wrong. It is a straight road."

There followed discussions about cameras at a nearby school and shops and the best vantage points to get their target.

Duffy goes on: "I just need a quick look. I almost hit him a couple of years ago."

He then added: "We'll just drive up to him and f***in jump out and blast him. In his ear. There 's an AK that could possibly be getting made available for us with armour piercing rounds. The thing about that is that's it's too f***in high profile for this first."

At one stage Sands makes a reference to someone walking along the beach and Duffy asked: "Was he on about this boy here or the Adair, and is told by Sands: This boy here."

Not all the bugged chat was terror-related. Just hours before this conversation Duffy and Hughes were heard in Duffy's flat chatting about square sausage and the best way to cook it. Detectives had to listen through hours of such talk in what was a massive and highly expensive operation by Police Scotland.

In court Duffy's cellmate in Castle Huntly Edward McVeigh, 27, revealed that Duffy hated Adair and talked of shooting him as he walked his dog or trained at the gym. Duffy had a copy of Adair's autobiography.

He said that Duffy was a Republican sympathiser who claimed he was a member of the Real IRA.

Paul Kearney, prosecuting, asked Mr McVeigh: "How often did you discuss the possibility of taking out Johnny Adair with Antoin Duffy, and he replied: "I'm not sure. Every couple of days.

"He didn't like him. He hated him because of who he is and because of what he's done in Northern Ireland. He's responsible for a lot of murders. They murdered innocent Catholics and claimed they were political targets."

Mr McVeigh said Duffy boasted that he would pull the trigger of the Big Fella himself to kill Adair.

He said that Duffy intended to pull the trigger himself.

Mr McVeigh added: "Antoin had a bitterness and hate because the British ruled the north of Ireland and British soldiers were still occupying the north. He wanted a united Ireland."

The court heard that Duffy was so charismatic that he persuaded McVeigh, who was from a fiercely Loyalist background, to convert to Catholicism.

Duffy, who was serving the end of a five-year sentence for having a gun in a Glasgow nightclub, also used his time in jail to make contact with people who might be able to source firearms.

It was his links with the Convery crime family in Renfrewshire that was to make his plot viable, and provide the Big Fella.

Duffy, Hughes and Sands were detained on October 23, 2013, the same day that police raided a flat in Green Road, Paisley. It was here that the  in a locked cupboard in the common close outside the flat hidden under Christmas decorations, deck chairs and an old Hoover.

The weapon was not in good condition and would have needed repaired - with BluTac, the High Court heard - to be used. Its firing pin was broken.

Bullets found with the gun would have been useless. Eight found were duds of the wrong calibre and filled with green lentils. There was one live bullet, but it was also the wrong calibre.

The jury was shown a video of the Big Fella being fired by a forensic officer.  

The flat was the home of Paul Donnell, who denied any knowledge of the assault rifle. Donnell was jailed for nine years last year after an arsenal of weapons was found in Erskine. He was named in court papers as having been involved with two of Duffy's co-accused, Gordon Brown and Craig Convery, who faced organised crime charges.

On September 2, 2013, Duffy was heard on tape to say to Miss McAllister: "I'll just go and get and shoot people. Terrorism, but not to shoot civilians. I'm not asking for permission I'm setting up on my own. I'll do the IRA proud."

Duffy even approached Celtic star Anthony Stokes in the Brazen Head pub on September 1 asking him to get his father to pass a message on to someone in Ireland to obtain weapons.

Regulars reacted with fury to this and Duffy was thrown out of the pub and seen jumping up and down with rage outside in the street by undercover police.

Later in his home Duffy was heard to tell his girlfriend Stacey McAllister that he had walked up to striker Mr Stokes and asked him to get his father to speak to someone about guns.

He told her: "I wanted to go and talk to Anthony Stokes and see if his dad could get a message to Donzo about these f***ing weapons.

"I seen Anthony Stokes tonight and ah says listen I need to talk to your dad and then everybody started jumping in going uh blah, blah, blah, know what I mean.

"They're singing songs and all this carry on saying you can't do this. I said leave me alone. Not one of them has ever had to go on an operation where they got shot."

In evidence Mr McCrory admitted that the killing of him and Mr Adair would be huge scalps for dissident Republican groups.

He said that he and Mr Adair had received a number of death threats, before adding that anyone who killed them would be held in high esteem by the Republican movement.

Mr Adair said that in October 2013 he returned from holiday to be told by police that his life was in danger from dissident Republicans and to step up his security.

He added: "All that was supposed to be over, but from their point of view I would see myself as a target as a leader of Loyalism."

When asked who he thought would target him replied: "All dissident Republicans."

Mr Adair, who was brigadier of C Company UFF in Shankhill Road, Belfast during the Troubles, told the court he was now a man of peace and added that Republican dissidents whom he described as fools and criminals were shooting soldiers on the streets of Northern Ireland.

Mr Kearney said: "Do you consider yourself as irrelevant to Northern Ireland politics now?" Mr Adair replied: "Yes, but I still get visited by police telling me my life is in danger from dissident Republicans and told to step up my security."

He was asked if he would be in danger if he returned to Northern Ireland and said: "Well, according to the police."

When asked if his group was responsible for the murder of up to 40 Catholics he said: "It has been reported as that."

Adair was asked if he knew any of the men accused of conspiring to murder him and said he didn't.

Mr McCrory who was convicted of conspiracy to murder and possession of a AK47 and a sub-machine gun and sentenced to 16 years in 1993 and released during the Good Friday agreement, said he was also contacted by police in October 2013 and told his life was in danger.

He said he had only been involved in one military operation in northern Ireland a plan to kill two IRA chiefs, but was caught on the way carry out the killings.

Mr McCrory, who described himself as a political prisoner, said: "I've never killed anyone."

He was asked if he thought he and Adair would be targets of dissident Republicans and replied: "Yes, it would be big scalps for them."

This was key for Duffy, who is also called Anton. He had hoped killing McCrory and Adair would establish his emerging gang bonafide terrorists and heat up the war again.

Irish Republicans have never struck in Scotland before. Extreme unionists, however, have, in the 1979 Glasgow bombings.

Police were aware of the risk posed by unionist fringe groups, including wannabes, with links to organised crime and Northern Ireland in the run-up to the referendum. Even a small risk of political violence at such a sensitive time was deemed unacceptable.

During the trial there was high security in force. Court 3 was isolated from the rest of the court building and armed police guarded outside the courtroom.

Duffy and Sands were brought to court each day in a police convoy which consisted of five police cars and six police motor cycle escorts and prison vans.