Kelly McGillis, the Hollywood actress who made a year's commitment to the Shakespeare Theatre at the Folger, will leave the company at the end of next week because she's expecting a baby. McGillis, who is two months pregnant, has been advised by doctors not to work during her term. Taking a hiatus from her film career, she is now starring in the theater's sold-out production of "Twelfth Night," which has garnered rave reviews. McGillis had signed a "seasonal" contract with the theater through June, but has been released from it. The movie star, who is in her early thirties, has been in such films as "Witness," "Top Gun" and "The Accused," and was set to play lead roles in "Mary Stuart" in February and "The Merry Wives of Windsor" in April at the Shakespeare Theatre. She was to have skipped the theater's presentation of "The Tempest" in December to prepare for the demanding role of Mary Stuart. "I will miss everyone a lot, but some things are bigger than theater, like taking care of another life," said McGillis yesterday. "I don't like having things undone, but at the same time I am happy to be pregnant." But she said she has regrets about leaving so soon after her much-publicized move to the theater from California, considered risky for a top-grossing screen star. "The reviews have been very nice, and I love the intimacy of playing before a live audience, because you can't lie as an actress," McGillis said of her current role as a woman impersonating a young man. "I'm also a little sad, since I have been researching and working on 'Mary Stuart' a lot already and now I won't get to do it." Also disappointed is Shakespeare Theatre Artistic Director Michael Kahn. "We looked forward to Kelly finishing out her year here, but I do understand the stress she would go through to continue and she needs to protect her health," he said. "When she came here, she wanted to try a variety of roles and to stretch her instrument, and one play, of course, is not as good as three." Kahn does not expect the departure of the celebrity actor to lower attendance. "Twelfth Night" is now operating at 110 percent capacity and has been sold out since its first week. "People will come to plays if we do them well," he said. Kahn is now casting for an actress to replace McGillis in "Mary Stuart." "I have several people in mind. We're looking for the best actress, whether or not she's well known outside of the theatergoing public." McGillis's situation is hardly the first of its kind, but at least her departure is amiable, unlike that of one of her predecessors in the theater world: Legendary actress Helen Hayes was forced to leave a long-running production of "Coquette" in the 1920s after possible complications during one of her pregnancies. "I was three months pregnant," Hayes remembered yesterday, "and after a matinee one day, my doctor put me in bed with books under my feet to keep them elevated and there I stayed." When the play abruptly closed following Hayes's departure, the other actors in the production sued the producer for not giving them sufficient notice. They lost, however, when Hayes's pregnancy was dubbed an "act of God" by a court. "Like fire, plague and riots," said Hayes. McGillis, who married yacht broker Fred Tillman last year, declined to comment on possible medical complications. "It's a personal thing between me and my doctor, but I was told not to work," she said, adding that though she and her husband were not planning to have children yet, "we were not avoiding it either." At the abortion rights march in Washington last April she told reporters, "I look forward to having a family -- someday." McGillis will finish the run of "Twelfth Night" -- it closes Nov. 19 -- and then will return to Los Angeles in December. After she has her child in June, she expects to begin work as producer of a film version of the feminist classic "The Awakening," by Kate Chopin, for Turner Network Television. She has no definite plans to return to Washington. "I'd like to be back at some point to finish my season, because I have enjoyed it so much so far," said McGillis. "But who knows, maybe I'll just drop into the abyss of motherhood and you'll never hear from me again."