Soldier and former prisons inspector;

Born: May 21, 1944; Died: October 12, 2012.

Clive Fairweather, who has died aged 68 of cancer, was best known for his role as second-in-command of 22 SAS regiment during the Iranian embassy siege in London in May 1980. While the publicity which surrounded the successful storming of the building – the latter stages of the attack were shown live on television – marked his career in a dramatic way, there was more to his life as a soldier than high-profile heroics.

Nine years later, while in command of 1st King's Own Scottish Borderers (KOSB), he demonstrated another kind of showmanship when the regiment celebrated its 300th anniversary. Instead of the usual parades he decided to recreate the moment when the regiment was formed for the defence of Edinburgh in March 1689. He flew the battalion into Edinburgh's Queen's Park in military helicopters and then marched them up the Royal Mile in full combat order.

His planning for the Iranian embassy operation and the KOSB celebrations were typical of a soldier who was often considered to be a bit of a maverick. Like many other successful special forces commanders such as David Stirling, founder of the Special Air Service regiment, or Orde Wingate, the creator of the Chindits, Clive Fairweather conformed to a well-known, if not always accepted, military type.

They all displayed a leaning towards the unconventional yet they used the estimation as a cloak; being considered oddballs in a conformist society, nothing would be expected of them provided that they did not break the basic code of soldiering.

He was born in Edinburgh and educated at George Heriot's School. His original ambition had been to train as a professional musician – he remained an excellent pianist and often surprised even close friends with his skill – but he was also attracted to a military career. On leaving school he joined the Territorial Army as a private soldier and gained his wings as a paratrooper in 15th (Scottish) Parachute Regiment.

Trained at the Royal Military College Sandhurst he was commissioned into the King's Own Scottish Borderers but his heart was set on something more adventurous and after six years with the 1st battalion he applied for a posting to the SAS. After passing the gruelling selection process he spent 13 years in 22 SAS regiment seeing service in Northern Ireland, the Far East and the Middle East, where he advised the Jordanian government on security matters.

After a stint as a staff officer in Germany, in December 1984 he was appointed commanding officer of the Scottish Division's infantry training depot at Glencorse Barracks outside Edinburgh. Within a few weeks he found himself plunged into controversy following the murder of three soldiers engaged on a pay-run to a bank in nearby Penicuik. More than £19,000 was stolen by Corporal Andrew Walker who then shot his colleagues in cold blood. It was one of the Scotland's worst ever murders and Fairweather found himself involved in a media storm which he handled with skill and sensitivity.

An even bigger challenge awaited him four years later when he took over as commanding officer of 1st King's Own Scottish Borderers in West Berlin. At the time it had been racked by a bullying scandal which involved humiliating initiation ceremonies and the scandal was headline news. On taking over command Fairweather rooted out the main culprits and quickly restored order and morale. He ended his army career in the rank of Colonel and between 1991 and 1994 served as Divisional Colonel of the Scottish Division based in Edinburgh Castle.

A civilian for the first time in 34 years, Fairweather soon found himself back in deep water when he accepted the appointment of HM Chief Inspector of Prisons. The invitation came from Ian Lang, at the time Secretary of State for Scotland, who claimed Fairweather was the best man for the job. Others disagreed: Lang's successor, Michael Forsyth, allegedly described him as a "dangerous adversary" when Fairweather gave notice that he was going to be nobody's yes-man.

His damning reports on Scotland's prisons made uncomfortable reading for politicians and prison governors alike. He opposed the practice of slopping out, was critical of privatisation and disagreed with moves to close Peterhead prison with its specialist unit treating sex offenders. It came as little surprise when he was not re-appointed in 2002, a victim, many thought, of his own honesty and integrity. In other words, the Government asked him for an honest appraisal of failings within the prison service and then balked at the results.

During this time he was special adviser to the Airborne Initiative, the pioneering organisation which provided alternatives to custodial sentencing for high tariff male offenders and was dismayed when the Labour-LibDem Government closed it down in 2004.

Latterly Fairweather acted as Scottish fundraiser for the charity Combat Stress, which provides help for service personnel suffering from post-traumatic stress disorder, and he proved to be a tireless advocate of its cause. He often joked (not entirely convincingly) that but for the grace of some higher power he too could have been a victim.

A gregarious man with a wide circle of friends from many backgrounds, Fairweather was well-liked and admired in equal measure. He also proved to be exceptionally media-friendly and was always generous and accommodating when asked to comment on matters within his ken. Appointed OBE in 1990 and CBE in 2002, he was often referred to in the press as "Sir" Clive Fairweather. It amused him greatly but in fact a knighthood would have been well deserved.

He is survived by his former wife Ann and his children Nick and Charlotte.