The University of Oxford is top of the Times Higher Education World University Rankings, with Cambridge University second, up from fourth place last year.
A key factor in the rankings is income and both universities saw this rise in the past year, partly in the form of European Union research grants.
But this income could fall with Brexit, warned rankings director Phil Baty.
Times Higher Education, which compiles the rankings, said that margins were extremely tight at the top, with all the top-ranked institutions excelling against measures in teaching, research, citations, international outlook and income.
But Oxford and Cambridge saw significant increases in their total institutional income – up 24% and 11% respectively while their nearest rivals, the California Institute of Technology and Stanford University saw falls in income.
The researchers also point out that about a quarter of Cambridge’s research income, and a fifth of Oxford’s, come in the form of EU grants – a factor which they say underlines the risk Brexit could pose to the global performance of the UK’s leading universities.
The top of the global ranking of 1,000 universities in 77 countries is dominated by US institutions.
Other UK universities in the top 50 are Imperial College London in eighth place; University College London, 16th; London School of Economics and Political Science, 25th; University of Edinburgh, 27th; and King’s College London, 36th.