James Smithson went to university when study was almost optional. But inspired by science and radicalism, he made a fortune - and established a US institution. American academic Heather Ewing crossed the Atlantic to research his biography.

The Smithsonian Institution in Washington, DC, spans some 19 museums of art and history and science, and the National Zoo, as well as scientific research stations in a number of different countries, making it the world's largest museum and research complex. It is most famous as the home of America's iconic cultural heritage: the Star-Spangled Banner, Abraham Lincoln's top hat, Charles Lindbergh's Spirit of St Louis and Dorothy's ruby slippers from The Wizard of Oz. But who knew that this most American of places was the creation of an Oxford graduate? One who never even set foot in the United States?

Just inside Pembroke College, on a courtyard wall by the Porter's Lodge, is a plaque commemorating the mysterious man behind the Smithsonian, James Smithson. Smithson matriculated in 1782 as James Louis Macie (his mother's name, which he retained until he was 35 years old) and received his MA in 1786. He was the illegitimate son of the first Duke of Northumberland, and his mother was a cousin of the Duchess of Northumberland and a wealthy widow in her own right. Smithson dedicated his life to chemistry and mineralogy, living a restless, peripatetic life amidst the capitals of Europe. He never married and had no children. At the end of his life he left his fortune in a contingency clause of his will to the United States to found in Washington, under the name of the Smithsonian Institution, 'an establishment for the increase and diffusion of knowledge among men'.

Smithson's story is an extraordinary one. And yet it is one that is not particularly well known. When the United States first learned of the bequest, there was tremendous opposition in Congress to the idea of accepting the gift of a foreigner. 'Every whippersnapper vagabond that has been traducing the country might think proper to have his name distinguished in the same way', railed one South Carolina senator. Many of the advocates of states' rights also feared the establishment of a national institution in the nation's capital. And since Smithson had not left any detailed plans, there was endless debate over his motivations. The mystery was only compounded by the fact that the Smithsonian lost virtually all the papers and belongings of their founder in a fire early in the institution's history.

I came to Oxford in 2000 at the start of my research, in the hopes of finding evidence of Smithson's life here. I wasn't sure if much could be found. In the Pembroke College Archives I pored through the battel or buttery books, which recorded the students' daily expenditures, for beer and bread and other comestibles. The books gave me clues as to when he was in residence, and they also showed how much he was spending in relation to his classmates (Smithson was often the biggest spender, or close to the top of the list).

Oxford in Smithson's day was a famously decadent place. Some professors had not taught a course in years, and many of the wealthier students scarcely attended lectures. They lived a life on the whole unsupervised, free of many responsibilities, focused instead on games in the gardens and arrack punch and jellies in Oxford's many taverns and coffeehouses. There was a lot of gambling, a habit Smithson continued throughout his life (he came close, in fact, in the 1820s in Paris to losing his fortune entirely at the gaming tables). 'In no places of education are men more extravagant', declared Vicesimus Knox in 1781. 'In none do they learn to drink sooner; in none do they more effectively shake off the firm sensibilities of shame and learn to glory in debauchery; in none do they learn more extravagantly to dissipate their fortunes.' And Edward Gibbon, author of The Decline and Fall of the Roman Empire, described his 14 months at Magdalen as 'the most idle and unprofitable of my whole life'.

Smithson was a gentleman-commoner, which meant that he lived a life of great privilege. Nobles and gentleman-commoners enjoyed seats at table and common rooms with the Fellows. They had the most magnificent suites of rooms in college, which they decorated with prints and elegant furniture, making them into the sites of elaborate parties and drinking sessions. Graham Midgley's University Life in Eighteenth-Century Oxford (Yale University Press, 1996) offers a colourful window into the Oxford of Smithson's day.

The hierarchical nature of English society was keenly mirrored at the University. Under the nobles and gentlemen-commoners came the commoners, by far the largest rank of student at Oxford. And then there were the exhibitioners and scholars, who were at the University on scholarship. At the bottom were the servitors, who gained their education in exchange for waiting on their fellow students.

Each rank of student had its own costume. The noblemen stood out from afar. While everyone else's gowns were black, theirs were of brightly coloured silk, in whatever colour they and their tutor chose: a rich claret, perhaps, or emerald or turquoise. And the tassels (or tufts as they were called) on their velvet caps were equally easy to spot. They were gold instead of black - which gave rise to the term 'tuft-hunters', to denote those toadies who sought out the richest students for friends. In starkest contrast, at the other end of the spectrum, the servitors' gowns were of plain black stuff, and their caps, instead of the square academic cap, were round and sometimes derisively called cow-pats.

Smithson, despite enjoying the privileges of a gentleman-commoner, felt acutely his illegitimacy - and the fact that he did not enjoy the status of a nobleman, like other sons of dukes. The register of his matriculation at Oxford shows that he left blank the space where students were supposed to list the name of their father; Smithson was the only one during his tenure at Pembroke to omit this information.

This clue in the matriculation record at Pembroke became one more piece of the puzzle that helped illuminate Smithson's thinking, and how much he was consumed with efforts to claim his father. He annotated all the mentions of his father in his collection of books (the only items to survive the Smithsonian fire), and he collected memorabilia with the ducal arms on them; and of course, most striking of all was his decision to change his name. At the age of 35, he abandoned Macie for Smithson - to identify himself more publicly as a son of the former Hugh Smithson, who, as the first Duke of Northumberland, had become one of the most fashionable and talked-about members of the aristocracy in the early decades of George III's reign.

There was one other aspect of Smithson's story that became clear during my research. Typically, an education at Oxford in the eighteenth century was grounded, as it had been for centuries, in classics, logic and philosophy. But Smithson found a small coterie of people passionately dedicated to the exciting and distinctly ungentlemanly field of chemistry.

Chemistry was the cutting-edge field of Smithson's lifetime, one at the heart of the making of modern, commercial society. The decade of the 1780s, when Smithson was at Oxford, saw the founding of the related new sciences of mineralogy and geology, as well the publication of Lavoisier's revolutionary treatise, which laid the foundations for modern chemistry. Oxford was not by any means at the forefront of chemical and industrial developments in England. But just around the time Smithson was matriculating, the University refurbished the chemical laboratory in the basement of the Museum building (today the Museum of the History of Science) to accommodate it 'to the purposes of a chemical school', and hired Martin Wall to present the first series of chemistry lectures.

Pembroke, Smithson's college, seems to have been the focus of much of the growing excitement for chemistry at Oxford. The Master, the Revd William Adams, was said by one student to be 'considerably deep' into chemistry. And a number of students in addition to Smithson were very actively pursuing the subject. Davies Giddy (later Gilbert), who went on to become the President of the Royal Society in the late 1820s, was at Pembroke during this time. Another Pembrokian was Thomas Beddoes, the future father of the Romantic poet Thomas Lovell Beddoes, who went on to teach chemistry at Oxford after graduation, though he lost his position in the 1790s over his radical political leanings. Pembroke seems to have been a place where excitement about chemistry, modernity and ideas of liberty all converged. The Master was a regular correspondent of the Unitarian minister Richard Price, who in the 1780s was gaining widespread notoriety for his prominent support of the American cause.

Smithson carried these philosophical discussions on to the coffeehouse societies in London, and the scientific circles he joined in Europe, as he eagerly built an international network of colleagues - both to aid in the building of natural history collections through the exchange of specimens and to foster the spread of knowledge. Many of the friends from Oxford who were likewise dedicated to a life of public-minded science remained Smithson's close associates throughout their lives. Smithson believed that 'the work of scientists being for all men, they themselves should be considered citizens of the world'. His highest ambition was to be a benefactor of all mankind.

He wrote his will towards the very end of his life. Incredibly, his gift to the fledgling nation across the Atlantic very nearly didn't happen. His fortune was destined initially to go to his nephew and that young man's as-yet-unborn heirs. But Henry James Hungerford died six years after Smithson, still in his 20s, unmarried and without children - the event which set in motion Smithson's extraordinary bequest. Even then, the future of the Smithsonian was not entirely secure. The fortune was tied up in Chancery, at a time when the court was some 800 cases in arrears, the very scene evoked in Dickens's Bleak House. Even when the US succeeded in shepherding the Smithson monies through in two years, the cause stalled once again, as Congress debated for nearly a decade over Smithson's intent. It was 1846 when the Act to establish the Smithsonian was finally passed, 20 years after Smithson had penned his will.

For all the mystery, and all the serendipity, Smithson's bequest emerged from a deeply held belief in the power of scientific knowledge to advance society and better the human condition. Uncovering Smithson's story reveals these Enlightenment ideals at its heart, and opens up the possibility that it was at Pembroke - in an environment that fostered open debate and curiosity, epitomised by the convivial 'blue-stocking parties' held by the Master - that he first caught the spark of these ideas.

Heather Ewing is the author of The Lost World of James Smithson: Science, Revolution and the Birth of the Smithsonian (Bloomsbury, 2007).