Modern Rome - Campo Vaccino sold in five minutes with six bidders battling for the work which has only come up for sale once before, Sotheby's said.
The previous record was the £20.5m paid in 2006 for Venice painting Giudecca, La Donna della Salute and San Giorgio.
Modern Rome, which had an estimate of £12m-£18m, was the top seller at the Old Master and British Paintings sale.
Other highlights included Dutch artist Jan Lievens' study of the head and shoulders of an old bearded man wearing a cap (circa 1629), which brought £2.5m against an estimate of £2-3m.
Painted in 1839, Modern Rome - Campo Vaccino shows Turner at his "absolute best" and was bought by a London dealer on behalf of The J Paul Getty Museum in Los Angeles.
Prior to Wednesday's sale, the painting had only appeared on the open market once in the 171 years since it was painted.
It was offered for sale at Sotheby's by a descendant of the 5th Earl of Rosebery, who bought the painting in 1878 while on honeymoon with his wife Hannah Rothschild, and it had remained in his family collection ever since.
The painting has been on loan to the National Galleries of Scotland for the last 30 years.
David Moore-Gwyn, deputy chairman, UK and senior specialist in British Paintings at Sotheby's, said: "Turner's Modern Rome - Campo Vaccino has achieved a tremendous and much-deserved result this evening.
"This breathtaking image shows the artist at his absolute best and, for collectors, it ticked all the boxes - quality, superb condition, provenance and freshness-to-the-market.
"Over the last few months it has been wonderful to observe the response that the painting has received from collectors who come from all over the world."
An 1839 Turner masterpiece of a view of Rome has sold for £29.7m in London, breaking the artist's auction record.