Police armed with machine guns arrested two innocent women at gunpoint and held them in custody for 24 hours, where they were strip-searched.

They were among six people taken into custody by firearms officers, despite there being no evidence connecting them to a crime.

None of the six - who also included a man woken from his bed and arrested in his pyjamas at gunpoint - were charged.

The events were disclosed following an inquiry by the Police Investigations and Review Commissioner (Pirc), which examines the most serious incidents involving officers.

Armed police were deployed in Edinburgh seven times in under an hour and a half on July 22 last year.

Pirc commissioner Kate Frame said: "While these were fast-moving events, they resulted in police pointing their guns at eleven people on three separate occasions over a period of less than an hour and a half.

"A number of these people were detained and searched on the strength, principally, of allegations made by an unidentifiable male and this action in a number of instances appears to have been entirely unwarranted."

Chief superintendent Matt Richards, the head of Police Scotland's specialist services division, apologised to those involved.

"The nature of spontaneous firearms incidents means they require time-critical decision making, often based on information from the public that is incomplete or continually changing.

"Our firearms officers are trained to the very highest standards," he said.

"The officers involved in responding to this incident were all acting in good faith in what was a difficult and fast-moving situation. However, it is clear that on this occasion it was not handled well.

"A thorough review took place following the incident and a number of measures were put in place to address the issues that have now been identified by the Pirc.

"We are also writing to the individuals involved to apologise and I want to do that again publicly now."

At 12.06am unidentified man called 999 claiming five black men were outside his flat armed with guns, knives and tasers. Nine firearms officers were deployed but found no trace of any men or weapons.

A few minutes later the unidentified man called police again and said he was following the men in a car on Seafield Road.

About ten minutes later, police stopped two cars which were pursuing another car at speed. Their occupants claimed the car they were chasing was being driven by the men seen outside the flat earlier.

Firearms officers were sent to search for the car.

Shortly afterwards a car was found apparently abandoned on Seafield Road with its keys in ignition and its lights on.

Officers were ordered to detain its owner and search his flat and car.

The man later told the Pirc that he was woken by a loud knocking on his door, which he opened to find several officers pointing their guns at him.

He was handcuffed and searched in his pyjamas before it became clear that he was not involved in the earlier events.

Firearms officer later denied pointing guns at the man and his neighbours - a claim which the Pirc disputed.

At 1.24am, the unidentified man called police claiming he had found a vehicle on fire near Poplar Lane. However, officers found the object on fire was a bin.

Two minutes later, the man called police for a fourth time and claimed three of the people he had seen outside his flat were at a petrol station in the Resalrig area of the city.

After arriving they were approached by a man - believed to be the same man who had called them to the scene - who claimed the occupants of two nearby Audis were involved in the earlier events.

Armed officers blocked in both cars and pointed machine guns at the occupants of both vehicles, shouting at them to get out with their hands up.

All five were detained, handcuffed and taken into custody before being released. They included the two women who were later strip-searched.

The three men they were with were charged with threatening and abusive behaviour but the charges were later dropped.

The Pirc's investigation found the only evidence connecting any of the six people detained to any of the earlier events at the time were the claims of the unidentified man.

It also said officers had missed "numerous opportunities" to identify him, despite meeting him face-to-face twice.

Police pointed their guns at 11 people during the nights events, the Pirc said.