Community policing was pioneered by David Gray in the 1950s as a young chief constable in Greenock and when he became Chief Inspector of Constabulary for Scotland, he caused all forces to adopt in a more formal way closer contact between police service and other agencies.

He was born in Johnstone, Renfrewshire, and became a gamekeeper on a Houston estate. His love of the countryside infused all aspects of his work, including the breeding of Golden Retrievers, one of whom was a Scottish Kennel Club champion. His expertise with and dedication to the fly-rod remained with him for the rest of his active life.

When he realised the limited horizons offered by gamekeeping, he joined Renfrew and Bute constabulary, where he quickly reached the rank of inspector. Encouraged by his chief constable to apply for the post of chief constable of Greenock, he was appointed - unusually - from the rank of inspector in 1955.

One of his great concerns was the treatment of children by courts and, following his lobbying of the courts administration and Association of Scottish Chief Constables, police juvenile liaison schemes evolved.

In 1958 he was appointed chief constable of Stirling and Clackmannan. During his 11 years there, he was a most effective honorary secretary of the Association of Scottish Chief Constables. As a result of a Thyne scholarship from the English Speaking Union in 1969, he travelled extensively in the US and Canada to study policing methods.

During 10 years as Her Majesty's Chief Inspector of Constabulary for Scotland, he followed with persistent personal effort a sometimes difficult path towards professionalising the inspectorate and establishing for it a meaningful role in the Scottish police service, while recognising the independence of chief constables.

He was an active member of the UK Police Council, the International Association of Chief Police Officers, the Police Advisory Board for Scotland, the controlling committee of the Scottish Police College, and represented the Scottish police service at Interpol and United Nations. In recognition of outstanding service he was awarded the Queen's Police Medal in 1960, made OBE in 1964 and CBE in 1977. Throughout his distinguished career, David Gray was known to listen with a sympathetic ear to problems ranging from the practical policing of urban areas to the welfare not only of officers in rural communities but of their wives and families, whom he recognised as performing many unsung tasks in the interests of the service.

He is survived by his wife, Laura, with whom he spent his final years in an idyllic spot on the shores of Loch Fyne, and two daughters.