LONDON (AP) _ A man with a knife slashed a painting by the 16th century Italian artist Federico Baroccio at the National Gallery, officials said. He was ordered today to stand trial on charges of causing criminal damage.

The state-funded gallery, home of some of the greatest art treasures in Britain, said in a statement that the painting - ''The Madonna and Child with St. Joseph and the Infant Baptist'' - was cut in nine places in Wednesday's attack.

Guards wrestled the knife from the assailant, identified as Martin Came, 27. No hometown was provided.

The National Gallery said its conservation and restoration department will take ''maybe more than a year'' to repair the painting, which measures 44 inches by 36 inches and is said to be worth at least $1.6 million.

''At the moment, we believe that complete restoration will be possible,'' said a gallery spokeswoman who refused to be identified.

Came appeared at Bow Street Magistrates Court today on charges of causing criminal damage and was ordered to stand trial Feb. 1 pending medical reports from a western England hospital where he has undergone unspecified treatment.

Baroccio, or Barocci as he is sometimes known, worked at the same time as Michelangelo. Baroccio spent most of his time in the Italian city of Urbino but the two men met in Rome in the 1550s and Michelangelo encouraged the younger artist with his work.

The damaged painting had been on display since it was bequeathed to the gallery in 1831.

Gallery experts refused to estimate its value. But a lesser known work by the same artist sold for $209,160 at Christie's auctioneers last year.

Britain's domestic news agency, Press Association, said the painting, has been valued at $1.6-4.8 million.

But art critic Brian Sewell said the painting could fetch as much as $25 million. Baroccio was ''monumentally influential in his time ... and none of his work that is really authentic has come on the market for donkey's years,'' he said.

In 1987, a man with a shotgun blasted one of the gallery's greatest treasures, Leonardo da Vinci's drawing The Virgin and Child with St. Anne and St. John the Baptist, as it hung on show.

The da Vinci drawing underwent an intricate 15-month restoration and is now back on show. The gunman, Robert Cambridge, age 38 at the time, was ordered to be held indefinitely at Broadmoor hospital for the criminally insane when he appeared at London's Old Bailey Central Criminal Court in June 1988.