A public art gallery in Hull has bought a masterpiece of European painting in one of the most important additions to Britain's art heritage in years.

The Sienese artist Pietro Lorenzetti painted Christ Between Saint Paul and Saint Peter, around 1320. Dante had just written The Divine Comedy; it was a moment of bold innovation in European culture, when the gothic age of cathedrals was reaching its climax. Lorenzetti's painting is a revolutionary artwork in which we can spy the birth of modern ways of seeing.

This gold-decorated wooden panel is full of things that are astonishing to see in a painting that is 700 years old. Saint Paul holds a sword whose fancy red and black scabbard is painted with eye-fooling realism: it is not a flat sketch of a sword, as might be expected in medieval art, but a solid object that has been carefully recreated. Meanwhile, the faces of Christ and the two fathers of the church have a finely shaded fleshiness that makes them movingly alive.

All this realism was utterly new in Tuscany 700 years ago. That was why Dr Caroline Campbell of the National Gallery stepped in to slam an export ban on Lorenzetti's painting when it recently came on the market after being recognised as his work. "Lorenzetti was an artist ahead of his time", she says, his emotional dynamism "unparalleled in 14th-century Italian art." This rare masterpiece that had long lurked in a British private collection could not be allowed to leave the country.

Enter the Ferens Art Gallery in Hull. At a time when councils are considering selling off works from their art collections to alleviate financial pressures, and when the quickest way for a regional gallery to attract attention is to stage an exhibition by Damien Hirst or Grayson Perry, the Ferens has gone back to the golden age of British art-collecting in the 19th century when cultured factory owners and merchants stuffed museums such as Liverpool's Walker Art Gallery with medieval masterpieces.

The Ferens has an endowment fund set up by its founder TR Ferens in 1928 specifically to buy works of art. Its former director John Bradshaw also made a bequest to Hull and asked in his will for some of it to be used to buy a pre-1800 work of art. Bradshaw, who died in 2001 and was famous locally for giving lavish dinners at the gallery where he cooked the food, has got his wish.

The Ferens needed some help. Lorenzetti's painting is valued at £5m: that was knocked down to £1.6m through a private treaty sale. When the Hull gallery put up half of that, its offer was matched by the Art Fund and Heritage Lottery Fund to secure this purchase for a British public collection. "Even in the midst of funding pressures and cutbacks", says Art Fund head Stephen Deuchar, "the Ferens and its supporters have pulled off a great coup."

Right now the painting is in the skylit restoration studio on the top floor of London's National Gallery, where it is being cared for by the chief art restorer Larry Keith. It arrived there on a blazing heatwave afternoon when the natural light in this state-of-the-art workshop set off the reds, dark blues and mellow flesh tones of Lorenzetti's figures against their heavenly gold background. As Larry Keith and Caroline Campbell explained how tiny stellar dots stamped into the gold surface reveal the history of the painting – because the tools to make these patterns were handed down from studio to studio – Christ's eyes blazed with life. It was clear to everyone, as the experts got excited and their science gave way to sheer enthusiasm, that Hull has got hold of something special.