A painting of a colourful Glasgow scene, which was thought to be missing for more than a century, has been secured for the city.

The long-lost oil painting by Paisley-born artist John Knox depicts the Glasgow Fair on Glasgow Green around 1819-1822.

The picture, which turned up at auction in London in 2013 and was subsequently recognised as the missing Knox, will go on show at the Kelvingrove Art Gallery and Museum at the beginning of next month.

The artwork, entitled Glasgow Fair, is said to show the famous city holiday in an extraordinary amount of detail.

Featuring recognisable city landmarks, and the crowds which attended the event, the piece illustrates the fair in the early years of the city's expansion when trade, commerce, art and enterprise were flourishing.

Experts believe the painting's detail and social commentary are likely to appeal to a broad audience.

It shows more than 1,000 people from various cross-sections of society - including the rich, poor, soldiers, street vendors and beggars - on Glasgow's oldest common.

Glasgow Museums acquired the painting for £220,000, helped by support from the Glasgow City Council Acquisitions Fund, the Heritage Lottery Fund, Trustees of the Hamilton Bequest and Friends of Glasgow Museums.

Chair of Glasgow Life, Councillor Archie Graham, said: "John Knox's Glasgow Fair is a painting that belongs to Glasgow and we are delighted to welcome it home to the city.

"The visually striking work has great relevance for the people of Glasgow as it was painted by a local artist, who lived in the city for most of his life.

"And it shows Glaswegians enjoying themselves at the Glasgow Fair, in the city's oldest park. It also helps us understand the historical importance of a holiday many of us still enjoy every July.

"I've no doubt it will be an immediate draw for our visitors. They can learn lots more about the painting and the artist through a programme of events and activities that will accompany its display at Kelvingrove."

The artwork was thought to be missing for over 100 years, then in 2013 at Sotheby's in London it was sold as being by the Irish artist William Turner de Lond, depicting a fair in Aberdeen.

Subsequently, it was recognised as the long-lost Knox with the landmark Nelson Monument at Glasgow Green in the background.

Characters in the scene include soldiers from different regimental groups, traders, men gathered around a cock fight and a pickpocket. A woman can be seen trying to drag her drunk husband from an alcohol seller.

In the background, there are signs for Mr Taylor's Olympic Circus and Wombwell's Grand Collection of Beasts, the largest travelling menagerie in Britain.

The Heritage Lottery Fund's manager for Scotland, Colin McLean, said: "This painting is striking to look at and provides an important window into the social heritage of Glasgow.

"We are delighted to be able to provide our support for its acquisition and are sure that, given its new accessibility in Kelvingrove, it will be a source of great discovery and delight for people of all ages."