Melissa Joan Hart almost got fired from 'Sabrina the Teenage Witch' after a Maxim photo shoot.

The 47-year-old actress has recalled nearly facing legal action over the racy underwear shoot back in 1999 having already lost a role in 'Scary Movie' and broken up with her boyfriend "that night" before heading to a Planet Hollywood after party for the premiere of rom-com 'Drive Me Crazy'.

She told the 'Pod Meets World' podcast: "While I'm at the party, my lawyer shows up and goes, 'You did a photo shoot for Maxim magazine?'

"I'm like: 'Yes, I did.' They're like: 'Well, you're being sued and fired from your show, so don't talk to the press, don't do anything.'

"So I get a phone call on my cell phone from my mother, my producer, who was like, '"hat did you do?'

"And I was like, 'I don't know, whatever my publicist told me to do at the photo shoot. I did a photo shoot for Maxim!' It's Maxim, of course you're gonna be in your underwear."

However, she claimed her near-firing was because of the cover line Maxim went with, which read: "Sabrina, your favorite witch without a stitch."

After the news, Melissa cried in her father's arms as everything came to a head.

She added: "He comes up to me and goes, ‘You okay?’ I was like, ‘No'.

“And he hugs me, and I was crying even harder because my dad is hugging me, I’m being fired from my show, I was just fired from [‘Scary Movie’] and I just broke up with my boyfriend.”

She was accused of violating her Archie Comics contract, which insisted she "would never play the character naked", but Melissa insisted they "had no ground to stand on", while she did write an apology letter.

In a statement to Variety, show producer Archie Comics said: "Archie Comics knows nothing and has heard nothing about this, and it was decades before the current administration at Archie.

"It’s ancient history.”