Britney Spears will drop legal action against a Japanese fan she accused of being a stalker.
The singer had been seeking a restraining order
She is expected to withdraw a request for a restraining order to keep Masahiko Shizawa, 41, of Yokohama, Japan away from her.
The star had said Mr Shizawa sent her hundreds of love letters and photographs and followed her to her homes - but he said he was just an "avid fan".
If the case had not been resolved by Friday, there would have been a full hearing with evidence from both sides.
The two sides had been in negotiations to agree a settlement without the need for a full court case and have now reached an out-of-court agreement, a court spokeswoman said.
Spears is expected to file court papers on Friday to ask for the case to be dismissed, although details of the agreement are not expected to be released.
The 21-year-old singer had said Mr Shizawa turned up at her houses in Louisiana and Hollywood and wrote "I'm chasing you" on one photograph he sent.
But his lawyer said Mr Shizawa, a computer
programmer and inventor, was harmless and the confusion arose from a cultural misunderstanding.
Mr Shizawa returned to Japan when his visa expired but wanted to resolve the issue so he could eventually return to the United States.
Spears is one of the most popular singers in the world, and has cultivated an image as a sex symbol.
She was recently embroiled in another legal case after suing a footwear company for allegedly failing to pay her adequately for marketing their roller skates and accessories.