Hugh Trevor-Roper, who has died aged 89, became a life peer as Lord Dacre of Glanton in 1979 and was arguably the leading historian of his generation. He was surely the most versatile and eloquent. He was also a vivid personality, fearless of orthodoxies and fashions, whose distinctive political and intellectual philosophy drew him, in the course of a crowded life, into a succession of memorable public controversies.

Born the son of a country doctor in Northumberland, during a solitary childhood he acquired the love of literature and the feeling for language that would inform everything he wrote and said. He was educated at Charterhouse and Christ Church, Oxford. Christ Church, with its social confidence and worldly connections, drew him out. He began his undergraduate career not as a historian, the subject to which he changed after Moderations, but as a classicist. From 1937 to 1939 he was a research fellow of Merton College, Oxford, where he wrote his first book, Archbishop Laud (1940).

Then came the war, the decisive event in the shaping of a historian who was always alert to parallels between past and present and to the historical dimension of present events. He served in the Radio Security Service and the Secret Intelligence Service, working on the penetration and deception of the German secret service. Later he drew on that experience in The Philby Affair (1968).

More immediately, the war and its aftermath produced the classic that made his name, The Last Days Of Hitler (1947); a claustrophobic, Tacitean portrait of dissolving tyranny which is also a work of investigative genius. At the end of the war he had been commissioned by the intelligence services to discover what had happened to Hitler, whom Stalin was claiming was still alive. Trevor-Roper travelled through Germany, tracking down and interrogating survivors of Hitler's court and reconstructing not only the circumstances of the Fuhrer's death but the power structure of his regime.

In 1946 he returned to Christ Church, now as a student (or fellow). He quickly became a leading force in the college, where he was Censor from 1947 to 1952. Meanwhile his historical research had reverted to 17th-century England. An instinctive and sometimes merciless controversialist, he was soon engaged in the "storm over the gentry", in which he took on RH Tawney and Lawrence Stone over the economic causes of the English civil war. This was one of the most fertile historical debates of modern times, its interpretative influence long outlasting the original points of dispute.

But Trevor-Roper's interests could not be confined to a single period or country. His reviews and essays in the press, ranging widely in subject matter, both past and present, reached an audience well beyond the academic community. In 1957 he published a combative collection of short pieces for the general reader, Historical Essays. In the same year, at the age of 43, he was appointed to the Regius professorship of modern history at Oxford, a position he held, in conjunction with a fellowship at Oriel, until 1980. His inaugural lecture, a protest against the over-specialisation of his medievalist predecessors and a call for the engagement of historical studies with large issues of importance to the intellectual laity, established the guiding principles of his tenure of the chair.

Throughout his career he resisted, against the current of the time, the tendency of the academic community and of the historical profession towards introversion. Yet his objection was only to narrowness of vision, never to scholarship. The aspect of his tenure that he most enjoyed was his part in the scholarly training of Oxford's expanding postgraduate population. He was the most devoted and inspiring of teachers.

His tenure was colourful from the outset. He was quickly involved in a celebrated dispute with AJP Taylor, who had been a rival for the chair, over Taylor's The Origins Of The Second World War.

Then, in 1959, he challenged academic introversion on another front, taking on the powerful and, to his mind, stuffy heads of Oxford colleges, who had united behind Oliver Franks's candidacy for the chancellorship of the university. Trevor-Roper, always an unconventional Tory, drummed up the MA vote to carry another unconventional Tory, Prime Minister Harold Macmillan, to victory.

While Trevor-Roper occupied the public eye, his critics, sometimes even his friends, were urging him to write a long and weighty book. In reality his learning, though never paraded, indeed at times almost secretive, was formidable and exact. He has left behind an extraordinary range of scholarly writing, not all of it completed or published.

But the world, he felt, was not short of fat books on single subjects. His favoured form was the essay, sometimes the long essay - where insight must be concentrated, proportion maintained and the evidence of learning kept mostly beneath the surface. The genre allowed him to move across time and space and to draw on the breadth of his reading and reflection. He liked to notice resemblances here, or contrasts there, between societies or events or circumstances. Comparison was his essential intellectual instrument, as it was of the "philosophic historians" of the 18th century, Gibbon at their head, whom he admired. Everything that interested him seemed to remind him of something else.

In 1967 he brought together perhaps the most remarkable of his collections of essays, Religion, The Reformation And Social Change. Employing an almost dizzying range of material, the book centred on the revolutions that shook Europe in the middle of the 17th century and related them to the mental ferment that preceded and accompanied them. The essays reflected the influence of French historians, particularly Fernand Braudel and Marc Bataillon, who had deepened his interest in early-modern Europe. They also marked the movement of his thinking away from economics to ideas. They were the boldest exposition of lifelong persuasions: of his equation of historical progress with pluralism; of his impatience with closed intellectual systems (both past and present); and of his rejection of historical determinism.

He would return to the 16th and 17th centuries in 1976 in his study of European painting and politics, Princes And Artists. But by now his historical interests had become more evenly spread. He had already published a broad thematic study of the Middle Ages, The Rise Of Christian Europe (1965). His interest in modern Germany persisted, producing The Goebbels Diaries (1978), and a number of essays on nazism. He also wrote a series of essays on the historical writers of the 18th and 19th centuries, above all Gibbon, Macaulay, Carlyle and Burckhardt.

As the subject matter of his studies broadened, so Trevor-Roper, wearying of badly written articles in bloated specialist journals, strayed ever further from the beaten academic track. In A Hidden Life (1976, also published as The Hermit Of Peking), he discovered a wild orchid of a subject in the impostures and fantasies of the sinologist and political operator Sir Edmund Backhouse, who flourished in the late 19th and early 20th centuries. The wild farce and improbable triumphs of Backhouse's deceptions, in China and England alike, cheered Trevor-Roper amid the growing bureaucratic and conformist solemnities of academic life. His delight in la comédie humaine, which made him as enjoyable a letter writer as the 20th century can have produced, was accompanied by a strong satirical impulse and a no less strong sense of mischief. He was reputedly the author of The Letters Of Mercurius (1970), comical vignettes of the Oxford of the time of student revolt, modelled in part on John Aubrey, which ran in The Spectator.

In 1980, aged 66, he moved to Cambridge as Master of Peterhouse, where his conflict with what he saw as an enclosed and reactionary oligarchy among the fellows became another cause célèbre and another rich source of anecdote. He fell into controversy again in 1985, when he made much the gravest of those errors of over-confidence to which he was occasionally prone. As a director of Times Newspapers he examined the fake Hitler diaries and was taken in by them. His gift for detective work, which had produced such remarkable results in his books on Hitler and Backhouse, now deserted him. Perhaps that humiliation contributed to the mellowing, and to the growing tendency to self-deprecation, that grew conspicuous in his later years. His prose yielded something of its exuberance and assertiveness, though none of its elegance or suppleness or wit.

When he retired from Peterhouse in 1987 he had embarked on a series of collections of essays which had appeared in scattered places, and which in a number of cases he now substantially rewrote. Renaissance Essays appeared in 1985, Catholics, Anglicans And Puritans in 1987, From Counter-Reformation To Glorious Revolution in 1992. The volumes he planned on later periods were not completed.

Amid all his public controversies, Trevor-Roper remained an essentially private, even a shy man. In retirement he lived at Didcot, a town convenient for both Oxford and London. In his 80s, his mind as alert as ever, he bore a gradual and for a time almost complete loss of sight, and the advance of cancer, with stoical fortitude and good humour, sustaining, amid heaps of increasingly unmanageable paper, a scholarly correspondence around the globe. His wife Alexandra died in 1997. They had been devotedly married for 43 years. He is survived by three stepchildren.