Kevin Spacey and his production companies have been ordered to pay $31m (£23m) to the studio behind House Of Cards.

Spacey, 62, violated his contract’s demands for professional behaviour by “engaging certain conduct in connection with several crew members” in each of the five seasons he was involved in, according to a document filed in Los Angeles Superior Court.

The studio – MRC – had to fire Spacey from the show in its sixth season, re-writing the script to remove his central character and cutting the season from 13 to eight episodes so it could still meet deadlines.

This resulted in the loss of tens of millions of dollars, the document said.

Spacey had been playing the role of Frank Underwood before several sexual assault allegations were made against him, although he denies any wrongdoing.

MRC filed the arbitration demand in January 2019, seeking to recover its costs.

Spacey had filed a counter-claim, saying the production company had wrongfully terminated his contract and breached its obligations to “pay or play” under the agreement.

More on Kevin Spacey

His lawyers had also argued that the sexual assault allegations against him were not a major factor in the show’s losses.

The fight between between the two included an eight-day hearing in February 2020 which was kept secret from the public.

The arbitrator issued a 46-page ruling in July 2020, which remains confidential but found in favour of the production company.

According to a report in Variety, the petition stated: “The arbitrator found that Spacey’s conduct constituted a material breach of his acting and executive producing agreements with MRC, and that his breaches excused MRC’s obligations to pay him any further compensation in connection with the show.”

The arbitrator also found that “Spacey’s egregious breaches of contract” made him and his companies liable for MRC’s tens of millions of dollars of extra costs.

Spacey had appealed the initial decision to a panel of three more private arbitrators but they also found for the studio, making the decision final – and public – on Monday.

The actor and his companies – M Profitt Productions and Trigger Street Productions – were ordered to pay $29.5m (£22m) in damages as well as $1.2m (£900,000) in legal fees, and $235,000 (£175,000) in costs.

MRC said in a statement: “The safety of our employees, sets, and work environments is of paramount importance to MRC and why we set out to push for accountability.”

Several people have filed lawsuits alleging they were sexually assaulted by Spacey but the only criminal case brought against him – an indecent assault and battery charge that accused him of groping an 18-year-old man – was dismissed by prosecutors in Massachusetts in 2019.