A chance discovery may have unlocked the secrets behind one of the most notorious nudes in art history after a 19th-century portrait was unearthed in a bric-à-brac shop.

The Origin of the World by the French realist painter Gustave Courbet has hung on the walls of the Musée d’Orsay in Paris for 18 years.

The 1866 painting of a reclining nude woman’s exposed genitals scandalised French society. There were no clues as to the model’s identity or an indication that it was part of a bigger canvas.

Download the new Independent Premium app Sharing the full story, not just the headlines

Now, an unnamed collector believes that a portrait of a woman’s head gazing skywards that he picked up on the cheap is a missing part of the work, and the world’s leading Courbet expert agrees.

The buyer said he had an intuition that the painting he had bargained down to €1,400 (£1,200) was actually more important than the humble surroundings he found it in made out, according to French magazine Paris Match. He became increasingly convinced that it was a Courbet.

Jean-Jacques Fernier, of the Courbet Institute, was initially sceptical when “John” brought him the work. But after two years of tests and analysis of the canvas and its brushwork has left him convinced that Origin had been cut into pieces. He was able to align the paintings through grooves in the frame.

One art historian from the Compagnie Nationale des Experts thought he detected the work of Carolus-Duran. “Absolutely not,” replied Sylvie Brame, the authority on Carolus-Duran. “The tempestuous, broad, sensual touch ... such a perfect, realist complexion – it’s a Courbet,” she said.

The magazine suggests that the portrait, picked up for peanuts, could be worth as much as €40m (£35m), while the experts pointed out there were probably more parts of the canvas in existence.

After scrutinising the head, experts believe the model for Origin was Jo Hifferman, the Irish mistress of James Whistler, who also had an affair with Courbet. The artist had painted her several times including in Portrait of Jo, of which he completed four versions, and Sleep, an erotically charged work where she is naked and entwined with another woman on a bed.

The addition of the head means “it loses some of its mystery and some of its charm”, Mr Fernier conceded, adding there had been a reason Courbet cut the head off. It was suggested the move was to protect the model.

Origin was commissioned by Khalil Bey, the Turkish-Egyptian diplomat, who later sold it to pay off his gambling debts. It was not meant to be seen publicly but it still caused scandal in Paris with one critic describing it as a “little monstrosity”.

Maxime du Camp said after it was painted: “There is a word which describes the kind of people capable of this sort of trash, worthy of illustrating the works of the Marquis de Sade, but this word I cannot pronounce in front of the reader, because it is only used in pork butchery.”

It vanished after the Second World War before it ended up in the Musée d’Orsay in 1995.