Barry and wife Natalie have a troubled marriage

Williamson signed a contract to perform in the musical in Canterbury at Christmas, without consulting his BBC bosses.

It is believed the 37-year-old thought he could take a sabbatical like other members of the cast.

But he will now be written out of the programme he has starred in for nine years.

Williamson will film his last scenes in November, which will be broadcast early next year.

Shaun accepted another engagement at the end of this year which would clash with his commitment to EastEnders

BBC spokesman

"Unfortunately EastEnders contracts don't allow it so I have taken the decision to leave.

"EastEnders have generously extended my contract to run until November."

He thanked the production team and actors "for making the last few years such a wonderful experience".

"I shall miss them all but look forward to new challenges and an exciting future," he added.

Luckless

Other high-profile EastEnders such as Barbara Windsor and Steve McFadden are leaving the show temporarily to work in other projects.

Todd Carty, who played Mark Fowler, has left the Square and will be killed off by scriptwriters.

A BBC spokesman said: "Shaun accepted another engagement at the end of this year which would clash with his commitment to EastEnders.

"Regretfully therefore, we have only been able to extend his contract until November.

"It will keep Barry on screen into next year. We wish Shaun every success in the future."

Viewers have recently seen Williamson's character, minicab boss Barry, down on his luck.

His wife Natalie, played by Lucy Speed, is having an affair.