Hospital chiefs have thanked T2: Trainspotting director Danny Boyle after he praised them for saving the life of a key crew member.

The Oscar-winning director revealed that the crew member almost lost a leg in an accident during the filming of the movie.

But his colleague's leg and life was saved thanks to the hard work and care provided by staff at Edinburgh's Royal Infirmary.

The new movie - the sequel to the hugely successful 1996 film Trainspotting - shot scenes at the hospital last year.

Robert Carlyle, who plays the Francis Begbie character in the film, filmed a number of his scenes in the building.

His co-stars from the original movie, Ewan McGregor, Jonny Lee Miller and Ewen Bremner have all returned for the sequel.

Speaking at the premiere of T2 in Edinburgh, Boyle said: "One of our key workers was taken very, very seriously ill.

"The care and attention he received when we were making the film, right the way through the film, saved his life and then saved his leg.

"He is working again on a new Paul Thomas Anderson film with Daniel Day Lewis. That's all down to the NHS and the Edinburgh Royal Infirmary."

Dr David Farquharson, medical director at NHS Lothian, said: "We would like to thank Danny Boyle for praising the NHS at the premiere of T2 Trainspotting and thanking Edinburgh Royal Infirmary for taking care of one of the crew members working on the film.

"We were pleased to have worked with the film crew last May when they used the hospital for some key scenes and we're glad to hear that the crew member has now fully recovered and is back at work."

T2 is due to be released in cinemas on Friday.