Baroness James of Holland Park, who has died aged 94, was a critically-acclaimed mystery novelist and creator of fictional policeman Adam Dalgliesh.

Known as P D James – and invariably the “Queen of Crime” – she was born in Oxford and later lived between her house in St John Street and London.

Widely regarded at her peak as Britain’s finest crime writer, Baroness James first took up writing aged 40 and published her first book, Cover Her Face, two years later.

The first to feature Dalgliesh, it was to be followed by 13 more, as well as two featuring private detective Cordelia Gray and three standalone novels.

This week’s obituaries:

the inspiration for her 1986 work A Taste for Death was notably a visit she paid with her daughter Jane to St Barnabas Church in Canal Street, Jericho.

The novel is set after the grisly discovery of two bodies in the vestry of a London church, one of a homeless man and the other a baronet.

Baroness James told the Oxford Mail in 1986 that she had first imagined the scene three years previously: “We went along because my daughter thought I would like it.

“It had really quite a profound effect on me. As I went inside I had this idea of setting the bodies in the vestry. I could actually picture them there and little by little the picture started growing.”

For the finished novel, St Barnabas was transported to Paddington, London, renamed St Matthew’s and slightly altered inside.

Baroness James added: “With me, ideas for books nearly always start with a setting. It takes time for the rest to follow.”

Phyllis Dorothy James was born on August 30, 1920 in Walton Street, Oxford, to tax inspector Sidney James and Dorothy Hone.

The family moved to Cambridge where she attended Cambridge High School for Girls and she excelled, but left education at 16 because her father said the family could not pay for university.

After an unhappy stint in a Cambridgeshire tax office, she met Connor Bantry White and they married in 1941. The couple had two children, Clare in 1942 and Jane in 1944.

She spent the Second World War issuing ration books but moved to London with her husband and took a job in 1949 as an administrator for the National Health Service. Mr White, an army doctor, however returned from the war suffering from schizophrenia and spent a lot of time in hospital.

He died in 1964, never having witnessed her tremendous success as an author.

In 1968 she joined the Home Office’s police department, later moving to the criminal policy department in 1972.

She retired in 1979 and had intended to spend more time in Oxford after moving back to the city, but her work in various capacities, including as a Governor of the BBC, meant she instead spent weekends there. She was made a life peer in 1991.

Later she would be made an honorary fellow of both St Hilda’s College and Kellogg College.

She was also to remark at a dinner at Somerville College, in 1987, that she might never have written detective stories if it weren’t for her predecessor, Oxford crime writer Dorothy L. Sayers, though she was always dubious about the famous delivery of one of Sayers’ fictional murders, the injection of an air bubble into an artery.

P D James died on November 27 in her Oxford home. She is survived by her daughters Clare and Jane, five grandchildren and eight great-grandchildren.