Former “Grey’s Anatomy” and “Private Practice” star Kate Walsh has revealed she underwent surgery two years ago to remove a brain tumor.

“The words ‘brain tumor’ were never in my zeitgeist,” Walsh, 49, told Cosmopolitan magazine in an interview posted Monday. After having experienced unusual fatigue and trouble thinking in early 2015, “I went in for the MRI, and you know it’s serious when they don’t even wait, they’re like ‘Hey, the radiologist wants to see you.’ And she starts to say, ‘Well, it looks like you have a very sizable brain tumor’ — and I just left my body. My assistant had driven me there, and I had to go get him so that he could take notes, because I was gone. It was never anything I would have imagined.”

advertisement | advertise on newsday

Walsh, who had just finished work on her NBC comedy series “Bad Judge,” says doctors “suspected that it was benign, but they wouldn’t know for sure until they got in there. It was over 5 cm, like a small lemon in my head, causing quite a bit of damage: there was a lot of swelling, and I had started getting shooting pains in my head.”

She was in surgery three days after the MRI, and doctors removed the tumor completely, she says. “After that, I just really focused on recovery, and surrendering to that process. I love to work hard and do 800 things at once, and this was a really amazing lesson in just submitting to the process of healing. I did exactly what the doctors told me to do, and asked tons of questions when I had them, and got lots of support, and just took my time.”

She returned to work roughly nine months later, shooting the recently released film “Girls Trip” and the upcoming “Mark Felt: The Man Who Brought Down the White House,” as well as the Netflix series “13 Reasons Why” and the Roundabout Theatre Company’s Off-Broadway play “If I Forget,” which ran from February to April and earned her Drama Desk and Drama League Award nominations.

“Those cliché, existential things do happen when you have a brain tumor,” she said, “like, ‘How do I really want to spend my time?’ I want to be with my friends and family and work on projects that are hugely important to me, and fun, and that make a cultural contribution. But my health comes first. . . . ”