SAN FRANCISCO (AP) _ A painting once owned by Louis XIV and taken from the French national collection about 35 years ago has been discovered in a San Francisco museum and will be returned to France, a museum official said Thursday.

''It's their property,'' said Ian McKibbin White, director of the Fine Arts Museum of San Francisco.

The 17th century painting is the work of Roman artist Pier Francesco Mola and entitled, ''Erminia And The Vafrino Tending The Wounded Tancred.''

It and a companion Mola, ''Erminia Guarding Her Flock,'' were acquired by Louis XIV in 1685.

The Mola was part of the collection at the Elysee Palace in the early 1950s, White said, when ''it was removed ... by an employee,'' adding that he meant it was presumed to be stolen.

White, who estimated the value of the painting at several hundred thousand dollars, said the Mola was authenticated after two years of investigation by a curator from the Louvre in Paris.

In recognition of the discovery of the work, France will send the companion painting to San Francisco, and both will be displayed through the summer before returning to France, White said.

He said the ''Tancred'' painting had always been thought to be the work of Mola, but not specifically the companion piece to ''Flock.''

One of the problems in certifying the ''Tancred'' was the fact that records described it as oval in shape, compared with the rectangular picture today, said White.

It turned out, he said, that ''it was a custom, apparently, to frame certain paintings in an oval mask'' and to make the Mola companion pictures appear to be the same size.

White said the painting was acquired by San Francisco's de Young Museum from the Samuel H. Kress Foundation of New York in 1961.

He said many questions about the painting cannot be answered ''because most of the principal players in all of this are dead,'' including the officials of the Kress Foundation.