1994–2000: ER
Margulies made her feature film debut in Steven Seagal's action film Out for Justice (1991), playing a prostitute. In 1994, Margulies was cast in the pilot episode of the NBC medical drama ER as Carol Hathaway, an emergency care nurse who attempts suicide. Her character was originally intended to die; however, test audiences overwhelmingly wanted her to survive, so the producers changed the plot.
At the time she was offered ER, Margulies had also been offered an extended role on NBC's Homicide: Life on the Street, after a two-episode appearance earlier in the year. George Clooney, who had filmed the pilot episode with Margulies, called her to let her know that he had overheard producers saying that her character might become a series regular. He encouraged her to consider waiting for ER producers to call her and not take another job. Clooney was right, and Margulies accepted the role on ER in 1994.
She remained on the show as a series regular for six seasons until 2000 and returned to the show for one episode during its final season in 2009. She won a Primetime Emmy Award for Outstanding Supporting Actress in a Drama Series in 1994, and was nominated for an Emmy Award every year during her tenure on ER. She was the only series regular cast member to win a Primetime Emmy Award. She was also nominated four times for a Golden Globe Award during the show's tenure.
Originally, Margulies had signed a five-year contract to work on ER. She extended the contract for a sixth year, but made the "very difficult, painful decision" to opt out of another renewal. In 2021, she explained in her memoir, Sunshine Girl, that she had been feeling homesick for New York after spending six years filming the show in Los Angeles. She wanted to return to theatre and take on a leading role in The Mists of Avalon, a miniseries based on the 1983 fantasy novel of the same name, which she had loved as a child.
In 2021, Margulies said during an interview with Michael Imperioli and Steve Schirripa, "I thought, didn't I work six years on a show I loved — I loved being on ER, I was so grateful, and it was a great experience — but didn't I work this hard to be able to do theatre for $235 a week without worrying about my rent?" She explained that, before NBC offered her $27 million to sign on for another two years, she had already helped plan out the conclusion of her character's story arc on the show and mapped out a year's worth of work for herself.
In a New York Times interview with Bill Carter, Margulies shared that another factor in her decision was a desire to protect her ER character, Carol Hathaway, from certain story changes that were happening as the show continued on into later years. She explained that she didn't like how her character became the focus of too much romance whenever she wasn't with George Clooney's character, and that all of the research she had previously done in order to play the character was then undone by certain storylines.
Margulies recalled, "I'll never forget, there was a line [in the script] where [my character] says, 'I had to share a bathroom with seven sisters.' I was like, guys, I've been playing her as an only child for six years…I had actually done research on what it's like to be an only child. I was starting to feel very sad about a character I loved so much. It started to become very clear to me that without George, my character was just going to be the liaison to flashy sort of bits of things instead of one fluent, cognizant thought and I felt sad about it."
Had Margulies accepted the $27 million contract for a seventh and eighth year of ER, it would have made her one of the highest paid women on television. The actress said that she received intense, hurtful backlash for her decision to ultimately leave ER, but was "doing what fed me, as an actor," she said in 2021. "And keeping my promises to playwrights and directors who I'd already made a commitment to." She also said that she wanted to move on as an actress:
I had a year's worth of work waiting and a mortgage completely paid at age 32. I was under no illusion that I was going to be some big movie star. My dad said, 'If you got hit by a bus tomorrow, were you living your life truthfully, or were you waiting to get rich?' If I died and my soul started leaving my body, would I be looking down going, 'You idiot. You could have gone to Prague, you could have been on Broadway'? Those are the things I wanted to do.
In an interview with TV Guide, she further explained, "I felt like I had a great character and I did as much as I could do with her, but I was feeling bored. I wasn't excited about the work and I certainly didn't want to go out with a bomb, but as an inspiration."