Courteney Cox used to not believe in ghosts, but her perspective changed after she lived in a house she believed was haunted. She even had to sell the property for this reason.

The "Scream" star made the revelation during her guesting on "Jimmy Kimmel Live" Wednesday, during which the host asked if she ever saw a ghost, New York Post reported.

Cox admitted that she did, and she actually sold her Laurel Canyon pad because of it. "I didn't believe it at first," she said, noting that the property was once owned by burlesque dancer Gypsy Rose Lee, as well as singer-songwriter Carole King.

"So Carole King came over to my house and she said there had been a divorce that was really ugly, and there was a ghost in the house," Cox told Kimmel. "And I was like, 'Yeah, whatever.'"

"But other people who had stayed there with me — friends of mine — said they had an encounter with a woman who was sitting on the edge of the bed," Cox continued, adding that she didn't pay much heed to it at the time.

The "Friends" alum said she later participated in a seance with King to banish the spirit from the property. However, Cox was too busy admiring the Grammy-winner to pay attention to what was going on. "I was so in awe of her, I didn't listen to a word," she recalled.

Even after that, she still did not fully believe that her house was haunted. But then a UPS delivery driver convinced her otherwise. "I was at the house one day, not being a believer," Cox told the talk show host. "And the doorbell rang. It was a UPS guy or something, and I opened the door and he said, 'Do you know this house is haunted?'"

Cox replied, "Yeah, why? Why do you think that?" In response, the delivery driver said, "Because there is someone standing behind you."

That was all it took to convince Cox to let the house go, she joked. "And I was like, 'Let's sell!'" she added.

"What a terrible, terrible UPS guy. I mean, why would you say that to somebody?" Kimmel teased.

"I couldn't sleep there alone ever again," Cox said. She also confirmed that she really sold the house after that encounter.

"You just don't think of it the same way," she explained, adding that she would "start seeing things" in the home after her encounter with the UPS driver.

Courteney Cox
Courteney Cox came in No. 8 with earnings of $6 million. Reuters/Mario Anzuoni

In the new horror-comedy series "Shining Vale," Cox portrays Patricia "Pat" Phelps, who faces a similar situation. The character encounters a ghost after moving to an old mansion in Connecticut with her family in an effort to save her marriage with Terry Phelps, played co-star Greg Kinnear.

"Shining Vale" is set to premiere on Starz on March 6.