BALTIMORE -- The Walters Art Gallery has bought itself a masterpiece.

The canvas, unveiled yesterday, is the "Penitent Magdalen" by Guido Reni, ca. 1630, a long-neglected tour de force of Baroque Italian art.

Sexy yet sublime, disciplined yet free -- and as cunningly composed as the innards of a watch -- it is by any measure an extraordinary picture. Robert P. Bergman, the gallery's director -- who yesterday stood on a folding chair to take the veil from the picture -- described it as "the single most important Old Master painting purchased by the Walters since its establishment in 1931."

His high opinion of the picture is shared by Sydney J. Freedberg, chief curator at the National Gallery of Art, whose museum, incidentally, does not yet own a Guido Reni. Freedberg has described the Walters' purchase "as one of the most enviable acquisitions made by an American museum in recent memory."

The "Magdalen," to modern eyes, may seem a little plummy. That is the only reason a picture of such quality -- its condition is impeccable, as is its provenance -- was available in 1987 at such a bargain price.

No figure was disclosed. But knowledgeable sources say the museum paid approximately $500,000.

That is less than 1 percent of the more than $53 million paid recently at auction for a single canvas by van Gogh. Yet Guido, while he lived and for centuries thereafter, was as universally revered as Vincent is today.

Known to his contemporaries as "the divine Guido," he was famous for his beauty and his purity. As a blond and blue-eyed student, he was used by his teacher, Ludovico Carracci, as a model "when he needed one for angels." Guido, despite the sexiness of the Magdalen, seems to have been something of a mama's boy. His biographer tells us, "He never caused the slightest scandal. When observing the many lovely young girls who served as his models he was like marble." Though he gambled compulsively and wasted numerous fortunes, he went to mass each day.

He was born in Bologna in 1575. When he died there in 1642, the whole city mourned his passing.

While he lived in Rome during the first years of the 17th century, noblemen and cardinals -- and occasionally the pope -- visited his studio. Lord Byron thought the master's fresco of Aurora was by itself enough to justify a visit to the Holy City. Robert Browning thought his "Crucifixion" "second to naught observable in Rome." Stendhal thought the painter had the sensibility of Mozart; and Sir Joshua Reynolds taught that "his idea of beauty . . . is acknowledged superior to that of any other painter."

But Guido's reputation plummeted as our century began.

His deep devotion to the Catholic faith had something to do with it. The Victorians loved his unabashed moralizing (as did his Roman patrons and his fellow Bolognese). But his scenes of female saints in ecstasy, some of them bare-breasted, were insufficiently severe for those early-20th-century Protestant collectors who gave the nation the National Gallery of Art. (Andrew Mellon, for example, refused to purchase nudes.) The countless meretricious imitations of Guido's works, ground out for Catholic churches, also dimmed his reputation. So, too, less directly, did Bernard Berenson's lingering distrust of baroque Italian art.

The Walters' luscious painting is undeniably operatic. Though the New Testament offers only a vague description of the Magdalen, she was regarded, by Guido's day, as a beautiful harlot, saved by Jesus, who gave up her jewels and her ointments and spent her last 30 years as a hermit in a cave.

In the painting (which owes something of its mood to Magdalens by Titian) she is both a hermit and a looker. Her amazingly painted hair is red, implying passion; her skin is creamy white. Her foreshortened right hand -- which holds her dress from opening -- reinforces the undertone of sensuality.

The picture's composition is remarkably complex. It is part pyramidal, part spiral. The light that falls from upper left is subtly crisscrossed by another triangular ray, the one defined by her right and the cross, that points to the upper right. The drapery is an essay in virtuosity. The colors could not be more delicate. The entire image is suffused by a diaphanous, rosy light.

The "Magdalen" was owned by a Roman nobleman, Flavio Chigi, by 1692. It also is mentioned in inventories of his family's collection dated 1705, 1770 and 1793. In March 1804, it was sold by Christie's in London -- for

241 -- to a Scottish baron, George Kinnaird of Rossie Priory, Perthshire. It remained in his family's collection until it was sold again -- at auction, without fanfare -- to a Dutch collector in 1946.

Eric M. Zafran, a Walters curator, spotted it some months ago in the New York gallery of dealer Piero Orsini. Though other art museums had declared an interest, it turned out that Zafran had got there first and put in the first claim.

The money that bought it came primarily from income earned by the museum's W. Alton Jones Foundation Acquisitions Fund, which was established with a $1 million gift in 1984. The Guido Reni will be a centerpiece of the baroque galleries in the original Walters building, now being renovated, which will reopen to the public in May 1988.