The much sought after actor, who was recently seen in Peter Greenaway's The Pillow Book, willingly made the crossover to the small screen because he enjoys the Chicago-based hospital drama so much.
"I did ER because I really like ER," he said yesterday. "I got an opportunity to do one and I thought it would be a laugh to see myself in an episode with all the people I'm used to watching in it."
McGregor, who plays a hot-headed robber called Duncan, pulls out all the stops in a gripping storyline that fills the whole episode, to be shown by Channel 4 on Sunday, 13 April. "I play a Scottish maniac," he laughed.
He is supposed to be visiting his American-based cousin when the grocery robbery they plan goes violently wrong.
A witness, Nurse Hathaway, played by Julianna Margulies, desperately tries to win their trust so she can treat the dangerously injured victims.
McGregor filmed the episode while he was in the United States working on A Life Less Ordinary with Cameron Diaz and Holly Hunter.
Although best known for his appearances in Shallow Grave and Trainspotting, the adaptation of Irvine Welsh's bestselling novel, McGregor has been capitalising on the success of the films in the US to broaden his range. He is currently working on The Velvet Goldmine, about the British glam rock scene in the 1970s.