Mindy Kaling is thrilled she's getting to leave 'The Mindy Project' on her ''own terms''.

The 38-year-old actress, who first starred as the successful doctor back in 2012, took to Twitter to pay her own tribute to the show - which aired for six seasons - ahead of its finale on Monday night (13.11.17).

She wrote: ''Six years ago I created a show called #TheMindyProject and got to play the lead. Not the sassy friend or nagging wife. It completely changed my life. 117 episodes later, it's ending, on my own terms. That's so rare, and I just want to say how grateful I am. Love forever, MK (sic)''

Mindy also paid tribute to her collaborators on the show, crediting them with helping her to hide her real-life pregnancy from TV viewers.

Prior to the finale, the actress - who announced she was expecting her first child in August - wrote on the micro-blogging website: ''I shot the entire last season pregnant and @MrSalPerez hid it so well! As did Michael Spiller and our cinematographer, Marco Fargnoli. The finale I was almost 7 months along and it was a heat wave. See if you can tell... (sic)''

Later, the American star revealed she'd been busily reading fan reaction to the show, but explained that because of her pregnancy, she felt too tired to respond to all of her well wishers.

She wrote: ''Ahhh I just want to favorite your tweets all night but I'm lying down, mega preg, and my own title card is telling me to go to bed. [sleeping emoji] I will catch up in the morning! (sic)''

In October, Mindy confirmed she is expecting a baby girl and also revealed she's ''having a great time'' being pregnant.

She said: ''I'm very, very pregnant. I've had a pretty great time of it so far, but I think I took a lot for granted before this, now that I'm in my current situation. Like, sitting, I'm obsessed with sitting and even when I was standing back there I was looking at this chair and I was like, 'Awww, can't wait to sit in that chair!'''