Image copyright Getty Images Image caption Dan Mallory went straight to number one on the New York Times best-seller list

Dan Mallory, author of the best-selling The Woman in the Window, has admitted to lying about having brain cancer.

Mallory, who wrote the thriller under the pseudonym AJ Finn, said he claimed to have had cancer as a way to disguise his struggles with bipolar disorder.

His admission comes after a New Yorker profile accused him of a history of lies about his personal life.

The US author told the magazine it was "never the goal" to "take advantage of anyone else's goodwill".

Mallory was a book editor before The Woman in the Window, his debut novel, was published in January 2018. It debuted at number one on the New York Times best-seller list.

A film adaptation of the book, about a woman with agoraphobia who begins spying on her new neighbours, is out later this year, starring Amy Adams and Gary Oldman.

Image copyright Getty Images Image caption Mallory's debut novel has sold more than two million copies

The New Yorker claimed Mallory had repeatedly said he had been diagnosed with brain cancer, including in a university application and to colleagues while working at publishing houses in London and New York.

The article also alleged that he said his mother died of cancer and his brother also died.

Although his mother did have cancer when Mallory was a teenager, she and his brother are both alive.

In response to the New Yorker piece, the author wrote: "It is the case that on numerous occasions in the past, I have stated, implied, or allowed others to believe that I was afflicted with a physical malady instead of a psychological one: cancer, specifically.

"My mother battled aggressive breast cancer starting when I was a teenager; it was the formative experience of my adolescent life, synonymous with pain and panic. I felt intensely ashamed of my psychological struggles - they were my scariest, most sensitive secret."

He said he was "utterly terrified of what people would think of me if they knew" about his mental health problems, and would think he was "defective" or would not believe him. "Dissembling seemed the easier path."

He added that "like many afflicted with severe bipolar II disorder, I experienced crushing depressions, delusional thoughts, morbid obsessions and memory problems".

He continued: "It's been horrific, not least because, in my distress, I did or said or believed things I would never ordinarily say, or do, or believe - things of which, in many instances, I have absolutely no recollection.

"With the benefit of hindsight, I'm sorry to have taken, or be seen to have taken, advantage of anyone else's goodwill, however desperate the circumstances; that was never the goal."

His agent confirmed the statement to BBC News.

A spokesman for HarperCollins UK told The Bookseller: "We don't comment on the personal lives of our employees or authors. Professionally, Dan was a highly valued editor and the publication The Woman in the Window - a Sunday Times bestseller - speaks for itself."

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.