The incredible story, and its heart-rending portrayal in one of the world's most popular films, likely played a role in pushing the instrument's price to 900,000 pounds, or past 1 million pounds when the buyer's premium and tax are taken into account.
"It's a world record for a Titanic artifact," said Peter Boyd-Smith, a Titanic memorabilia collector at the auction, hosted by Henry Aldridge and Son in the western England town of Devizes.
"The only other items that are probably worth that kind of money are the items salvaged from RMS Titanic if they are ever put up for sale and those are in the exhibitions that go around America and Europe.
"It may never get beaten."
The violin, with Hartley's name on it, is believed to have been found at sea with the musician's body more than a week after the Titanic sank.
"Mr. Hartley and the band were very brave people ... standing by their posts to the bitter end," auctioneer Andrew Aldridge said ahead of the sale.
Henry Aldridge and Son said the violin has been subject to numerous tests to check its authenticity since it was discovered in 2006. It said earlier this year that the violin was Hartley's "beyond reasonable doubt."
The violin, of German make, was a gift from Hartley's fiancee Maria Robinson, and was engraved with the words: "For Wallace on the occasion of our engagement from Maria."
Andrew Aldridge said the buyer, who bid over the phone, wished to remain anonymous.