Media playback is unsupported on your device Media caption "A long life can pass by many milestones - my own is no exception"

The Queen has thanked well-wishers at home and overseas for their "touching messages of kindness" as she becomes Britain's longest-reigning monarch.

Speaking in the Scottish Borders, the 89-year-old monarch said the title was "not one to which I have ever aspired".

At 17:30 BST she had reigned for 23,226 days, 16 hours and approximately 30 minutes - surpassing the reign of her great-great-grandmother Queen Victoria.

David Cameron said the service the Queen had given was "truly humbling".

Dressed in turquoise with her trusty black handbag at her side, the Queen spoke briefly to the gathered crowds earlier.

"Inevitably a long life can pass by many milestones - my own is no exception - but I thank you all and the many others at home and overseas for your touching messages of great kindness," she said.

In the day's main events:

The Queen and Prince Philip travelled by steam train from Edinburgh to Tweedbank, where she formally opened the new £294m Scottish Borders Railway

They were accompanied by Scotland's First Minister Nicola Sturgeon, who praised the Queen's "dedication, wisdom and exemplary sense of public service"

In London, a flotilla of historic vessels, leisure cruisers and passenger boats took part in a procession along the Thames and HMS Belfast sounded a four-gun salute

The exact moment the Queen became the longest-reigning sovereign is unknown. Her father, George VI, passed away in the early hours of 6 February 1952, but his time of death is not known.

Her Majesty's Milestone

Image copyright Buckingham Palace Image caption Newly released official photographs show the Queen with her official red box, containing the day's policy papers, cabinet documents, Foreign Office papers and other letters

Business in the Commons was postponed for half an hour so that MPs, led by Mr Cameron, could pay tribute to the Queen.

The prime minster said she had been a "rock of stability" in an era when so much had changed, and her reign had been the "golden thread running through three post-war generations".

He said it was "typical of the Queen's selfless sense of service" that she thought today should be a normal day.

Acting Labour leader Harriet Harman said it was "no exaggeration" to say the Queen was "admired by billions of people all around the world".

Ministers are to present the Queen with a bound copy of cabinet papers from the meeting in 1952 when Sir Winston Churchill's government approved the content of her first Queen's Speech.

In the House of Lords, leader Baroness Stowell said the Queen had served the country with "unerring grace, dignity and decency", adding: "And long may she continue to do so".

Image copyright Reuters

Analysis: BBC royal correspondent Peter Hunt

There have been glowing tributes and much talk about the significance of this moment. No such words were uttered by the subject of all the attention.

She undertook a run-of-the-mill engagement on a far from run-of-the-mill day. And in her brief remarks - her lengthy reign hasn't lessened her aversion to making speeches - she displayed some classic British understatement.

Overtaking her great-great-grandmother wasn't something she'd ever aspired to, she said. She was simply the beneficiary of a long life.

In Scotland - and indeed in other parts of the United Kingdom - that life and her reign have been celebrated very publicly.

Privately, later, the Queen will mark the moment she enters the record books. Prince Philip will be with her - her husband of 67 years has been the one constant in a reign of sometimes dizzying change.

Image copyright PA Image caption In London, a flotilla of vessels, including Havengore and Gloriana, took part in a procession along the Thames

Image copyright PA Image caption Meanwhile, in Edinburgh, the Royal Party were welcomed by a traditional pipe band

Image copyright AFP Image caption The Queen and the Duke stopped off at Newtongrange station where she unveiled a plaque

Image copyright PA Image caption Children from Busy Bees Nursery turned out to see the Queen in Tweedbank

Buckingham Palace has released two official photographs to mark the occasion, taken by Mary McCartney in the Queen's private audience room.

This is where she holds weekly audiences with prime ministers of the day, and receives visiting heads of state and government.

The Queen is taking her traditional summer break at this time of year at her private Scottish home, Balmoral.

The Duke and Duchess of Cambridge are in Scotland on holiday and are expected to have dinner with the Queen at Balmoral later.

Queens of the modern age

Image copyright Getty Images Image caption Elizabeth II has reigned for 63 years and seven months, beating Queen Victoria's record

Victoria became queen at 18, while Elizabeth was 25

Elizabeth II rides in the same coach as Victoria did for the annual State Opening of Parliament

Both queens were shot at by lone gunmen while out riding near Buckingham Palace

Elizabeth loves the private royal estate at Balmoral, which was bought by Victoria

Victoria ruled over an empire of 400 million people. Elizabeth is head of state for 138 million people

Elizabeth and Victoria in numbers

Elizabeth II: Britain's Diamond Queen

Woman who redefined the monarchy

Queen Victoria became queen at the age of 18 and ruled for 63 years, seven months and two days.

Queen Elizabeth's reign has included 12 prime ministers, two more than served under Victoria.

Media playback is unsupported on your device Media caption Duke of York: "From her perspective it is business as usual"

One of those prime ministers, Conservative Sir John Major, rejected any suggestion the Queen had been too passive as head of state: "The monarchy wouldn't be as popular if they were part of politics - they're above and beyond it.

"But when the Queen meets her prime minister she has the opportunity to question, to ask, to counsel. Nobody knows and no prime minister is going to tell you exactly what happens at those meetings. So those who say she's been too passive, how can they possibly know?"

'Genuinely exceptional'

The Queen is Head of the Commonwealth and sovereign of 15 Commonwealth realms in addition to the UK, and the organisation's Secretary-General, Kamalesh Sharma, sent his congratulations.

"As a symbol of continuity during decades of unprecedented change, and by drawing our people together in their rich diversity, Her Majesty has embodied all that is best in the Commonwealth," he said.

"With vision and dedication her example has encouraged successive generations of leaders and citizens to embrace the promise of the future."

Media playback is unsupported on your device Media caption Graham Smith: "I don't think that keeping a job for life, for life, is something to get excited about"

Anti-monarchist group Republic said the Queen's long reign was a reason for reform not celebration.

Chief executive Graham Smith said: "It is now time for the country to look to the future and to choose a successor through free and fair elections, someone who can genuinely represent the nation."