Going To The Match depicts a bustling throng of football fans gathered at the former home of Bolton Wanderers.
It had been loaned to The Lowry gallery in Salford by the Players Foundation.
But the foundation said the financial crisis meant it was forced to sell the 1953 work, raising fears it could be lost from public display.
The buyer has been confirmed as The Lowry arts centre, securing its future at the gallery.
It was among a series of paintings that went on sale at Christie's earlier, and sold for a hammer price of £6.6m with an additional buyer's premium of £1.2m.
The total sum is a new record price for a work by Lowry sold at auction.
The sale was previously the subject of controversy, with the Mayor of Salford Paul Dennett insisting any new owner must keep it "free to access".
Lowry chief executive Julia Fawcett said the purchase was made possible "thanks to an incredibly generous gift from The Law Family Charitable Foundation".
She added: "We look forward to bringing it home to Salford, where it can continue to delight and attract visitors to the Andrew and Zoë Law galleries at The Lowry."
Andrew Law, who founded The Law Family Charitable Foundation with his wife Zoe, and has donated to the Lowry over the years, said the couple were "delighted" to have facilitated the purchase.
He added: "This LS Lowry painting belongs in Salford on public view, close to his birthplace, where he was educated and where he lived."
Mr Dennett, who wrote to prominent local figures and business leaders asking for help to buy the work, said: "I am delighted our campaign to save this critical and important painting has successfully resulted in The Lowry securing it tonight.
"We emphatically believed Going to the Match should remain on public view.
"For the city of Salford in perpetuity for generations to come, for residents and visitors to our great city."
Lowry, who died in 1976, spent much of his life in Salford and his work is strongly associated with the city.
Going To The Match is one of several football subjects painted by Lowry, who was always keenly interested in sport.
Many of the pictures have either direct or imaginary links with Burnden Park, the then-home of Bolton Wanderers, which was only a few miles from where the artist lived.
It won Lowry first prize in a 1953 exhibition, which was sponsored by The Football Association, and was last auctioned in 1999, when it was acquired by the charity for about £2m.