James MacMillan’s first opera Inés de Castro shocked and baffled the Edinburgh Festival crowd in 1996, but was taken to heart by the Scottish audiences, revived and even toured to Portugal. I remember the composer beetling out from the Theatre Royal auditorium at the end to take his bow on stage. It could easily have been left there, but when Scottish Opera suggested a new production, MacMillan jumped at the chance to revisit the score and relished the opportunity to be closely involved with the rehearsal process and conduct the performances, working with people he knows well. MacMillan says that there is a “creative forgetting” once he puts a double bar at the end of a piece, and he has had to relearn the opera from scratch.

The opera is musically dense in texture, highly demanding to perform for singers and players, extremely violent in its unremitting stomach-turning explicitness and it has to be said, totally thrilling from start to end. Even after all these years, there are key moments literally etched in the memory: an exhumed queen on the throne, a tender old woman cajoling and pleading with dying characters not to be afraid as they cross to the other side, an executioner’s song descriptive in gruesome detail and a battery of side drums spilling into the theatre’s boxes. Happily these are all still in place, and the opera has been sharpened up, deepening its already powerful impact.

This is the true story of the murder of the Spanish mistress of the Crown Prince of Portugal because she was considered a threat to the state. The opera is based on Jo Clifford’s 1980s successful play of the same title, seen by the composer at the Traverse Theatre. Director Olivia Fuchs has moved the action to a highly repressed regime in the 1970s, possibly Pinochet’s Chile, so Kai Fischer’s sets are crumbling concrete lattice, dust and votive candles illuminating pictures, presumably of the disappeared. A collapsed building seems to have left a form of a distressed concrete cross, and indeed, there is some moving liturgical singing at various points.

In the title role, Stephanie Corley was triumphant, confident in her relationship with Pedro, her prince with whom she has had two children, now heirs to the throne but unacceptably, half Spanish. It is a position that Pacheco, advisor to the King will not tolerate, and he convinces the King to dispatch Pedro to head up a unit of the Portuguese army in a knowingly vulnerable position. The idea is that he will die bravely. Paul Carey Jones as Pacheco was truly evil, bending those around him to get his way, stalking the action with his briefcase of prepared papers only requiring the hopeless King’s signature to start a catalogue of misery.

I had forgotten Blanca’s mad scene: Pedro’s wife explains to Inés about the series of miscarried children down to the detail of the deformed foetuses she is advised not to look at, but does all the same. It is a desperately sad tale of a loveless marriage and sung with passion by Susannah Glanville in a particularly strong second Act.

A women’s chorus appear, trying to wash blood out of garments which themselves form a red river. The heads of Inés’ children are presented to her in a black holdall, and as she is bound to an electric chair, an old woman appears out of the shadows to comfort her and lead her to another place: “Believe me, you don’t want to get old!” she entreats. Kathleen Wilkinson reprised her original role magnificently, helping both Inés and later the King to shed their worldly outer garments before passing on.

The problem for Pacheco is that Pedro survives and returns in triumph. Peter Wedd rails against the fixer and his weak father, ordering Inés to be dug up and put on the throne. In a nice period twist, Gary Griffiths as the Executioner uses an overhead projector to explain Pacheco’s truly horrible fate. No easy death by PowerPoint here as ‘old school’ felt-tip diagrams were as much information as we really needed.

This was a particularly well sung production, with every principal on top form. A strong semi-chorus of ordinary people was made up of current and former Scottish Opera emerging artists. With a difficult score requiring on- and offstage work, credit must go to the larger impeccably drilled chorus by Oliver Rundell making a huge impact as liturgical comment, repressed subjects, as well as colourful crazies, so disappointed that the executions happened without a decent party.

The final tableau has the People being made to garland the dead queen, now a rotting corpse haunted by the ghost of Inés invisible to all save only an innocent girl. Inés implores her to pass on the message of the opera that there has to be a better way, and calls her to heed her pleas for an end to repression and violence.

MacMillan directed his large percussion-laden orchestral forces with fiery precision. Musically, it is a busy score with lots going on, a mixture of lush, strident and shrieking and the spectacular use of percussion including double basses whacking their strings with the back of their bows. The ending of the first act with four side drummers hammering out irregular rhythms in perfect unison was particularly thrilling.

With its unrelenting assault on the senses Inés de Castro is not a comfortable evening. It is not supposed to be. Scottish Opera, with its welcome bold new foyer development, is firing on all cylinders in this powerful and unmissable production, the big disappointment being that there are only a total of four performances.