The Textile Museum's exhibition of fine old Turkish rugs is a rare and spectacular visual treat. First-floor galleries are hung with vibrant, centuries-old masterpieces, turning the mansion on S Street NW into a glamorous souk.

But beyond sheer beauty, this is a cultural detective story. And it takes as many twists and turns as the strap-work patterns on these magical carpets.

The show, "Classical Tradition in Anatolian Carpets," presents 52 examples of artistry in wool. The knotted pile rugs were made between the late 15th and 19th centuries, mostly in the eastern portion of Turkey once known as Asia Minor. Some carpets reflect the grandness of the Ottoman Empire, whose court workshops used fine materials, sophisticated palettes and elegant peacock swirls. Others were crafted by anonymous village women, who had bolder color sense and rougher technique but enough confidence to tweak standard geometries into new motifs.

Guest curator Walter B. Denny, professor of art history at the University of Massachusetts, Amherst, has crammed the galleries with themes, from the influence of tribalism to the limitation of weaving techniques to the transcription of decoration from other media. The delicate thread tying these ideas together is a search for artistic origins. Each vibrant carpet or tattered fragment becomes a link, however fragile, in what Denny calls a "chain of stylization." He manages to extend it through four centuries, around the Mediterranean Sea and, most interestingly, across religious divides.

As its chief contribution to scholarship, the exhibition presents a very fine 16th-century prayer rug, or sajjadah, from the James A. Ballard collection of the Metropolitan Museum of Art in New York. Denny believes the carpet design was a prototype for centuries of weavers whose rugs were destined for synagogues and churches.

"It is one of the most fascinating art-historical metamorphoses in the Islamic world," he says.

Prayer rugs are the best-known products of Anatolian carpet weavers. They also provide an excellent vehicle for understanding Denny's "chain." It appears that the craftspeople did not start from scratch with every commission but simply modified a basic prayer rug design.

The show opens with a brilliant red and blue fragment of an outsize prayer rug. It dates from the 16th or 17th century, the high point of Ottoman culture. Its design elements are emblematic of large and small prayer rugs. Rows of articulated niches indicate where worshipers were to station themselves on the mosque floor. Arches point the way to Mecca. Motifs of flowers symbolize the gardens of Paradise. Images of hanging lamps represent the divine light. Some rugs also indicate where a worshiper should put his feet.

The Met's sajjadah is a stunning variation on this theme. Its finely woven architectural features include coupled Corinthian columns supporting elaborate triple arches against backgrounds of red or black. A detailed lantern hangs from the central arch. A broad green border is filled with exquisite renditions of rosebuds, carnations, tulips, hyacinths, honeysuckle, palmettes and feathery leaves.

The carpet is a masterpiece of design as well as execution by court weavers, likely working in Istanbul, then called Constantinople. Little wonder that weavers elsewhere might seek to emulate its motifs.

Denny has seen variations of the design again and again in Turkish rugs, including those woven in the 20th century. Examples gathered at the Textile Museum show how details were simplified and border decorations modified, in keeping with artistic license and the talent of individual weavers. But some combination of coupled columns, archways and the hanging lantern remains.

Remarkably, the design also appears in at least two curtains that were hung in front of the Torah in synagogues. Denny has displayed these parokhets next to the Met's sajjadah for the first time, and to striking effect.

One parokhet, from the Textile Museum's collection, is believed to have been woven in an Ottoman court workshop in Egypt. Its overall design, from coupled columns to elaborate arch, appears closely related to the sajjadah made a century earlier in a different place. The ever-present lantern has been enlarged and redrawn as a chalice containing a menorah. Over the arch, Muslim weavers have worked in a Hebrew inscription: "This is the gate of the Lord: Through it the righteous enter."

A second example, lent by the Jewish Museum in New York, bears the familiar configuration of columns, arch and lantern. It was made in western Anatolia in the 19th century, likely as a replacement copy for an older work. Its finely executed border recalls the Met's sajjadah. But border medallions have been replaced by extensive Hebrew text. And the lantern has been decorated with the four consonants of the ancient Hebrew name for God, known as the Tetragrammaton.

In the catalogue, Denny acknowledges that some might ask, "What would Sephardic Jews have to do with the imagery of an Ottoman court rug destined for the Ottoman sultan or his family, and woven to further the practice of the five daily prayers mandated by the religion of Islam?" Denny does not delve into religious history. But his research did lead to fascinating writings documenting the use of Ottoman rugs in synagogues. In the catalogue, he writes of a 14th-century rabbi who advised his congregation on the subject. Addressing the appropriateness of using a Muslim prayer rug to cover the Torah, the rabbi replied that a carpet with an Islamic symbol, in this case a black square suggesting Mecca, should not be used. But, Denny goes on to say, the use of pile carpets in synagogues was not all that unusual.

Central European churches apparently also had prayer rugs with coupled columns. A 17th-century example, made in western Anatolia, shows significant variations but the same architectural theme.

The sajjadah also inspired more modest prayer rugs. In one 19th-century example, the sedate color scheme preferred at court has been replaced by lively, folkloric blues and reds. The floral border has been abandoned in favor of geometric patterns with nomadic or tribal origins. And the graceful columns have been shortened almost beyond recognition. The weaver of this particular carpet started with the parapet over the archway but seems to have run out of room. Instead of stately pillars, the rug has columns as short as chair legs. But they are still coupled.

Detective Denny does not produce an antecedent to the sajjadah. But he has searched far and wide for the architecture that inspired its design. No such coupled columns are seen in Turkish architecture. But Denny came upon a near-perfect model at the Alhambra, the famed 14th-century Islamic palace in Granada, Spain. There, in the garden pavilion, tourists today wander among coupled columns and tripled arches.

It is entirely plausible that inspiration could travel such distances. The Ottoman Empire not only lasted from 1300 to 1918, but it stretched from the Caspian Sea to the Adriatic Sea on the north, and from the Arabian Peninsula to Algeria in the south. Through trade and travel, its influence extended well beyond.

Denny notes that Turkish carpet designs had made their way to Spain by the 13th century and were popular under both Muslim and Christian patronage. By the end of the 15th century, the Spanish Inquisition provided the impetus for a reverse cultural journey.

Given the upheavals of time, weather, wear and war, it's a wonder that any of the carpets in this exhibition has survived. Some are in tatters and are displayed behind glass. But many, especially some wonderful geometric-patterned floor rugs, are not.

Knowledge about these carpets comes from an impeccable, if unexpected, source: Europe's Old Master paintings. In the 15th and 16th centuries, Hans Holbein the Younger, Hans Memling, Giovanni Bellini, Lorenzo Lotto and Domenico Ghirlandaio portrayed Turkish export rugs in such vivid detail that historians have named patterns after the painters. The dates of the paintings have provided guidance in dating the carpet designs.

A small gallery is devoted to photographic reproductions of the paintings with a matching rug hanging on the opposite wall. It is instructive that the painters showed the rugs draped over tables or under the feet of the Virgin Mary. In their golden age, such carpets were symbols of wealth and power, worthy of castles and cathedrals, as well as depiction in oil. Over the past century, such decorative arts have receded from view in major art museums. This only enhances the value of the Textile Museum and this very fine show.

With each twist and turn of colored wool, these rugs reveal just how close different communities could be.

The Classical Tradition in Anatolian Carpets, at the Textile Museum, 2320 S St. NW, through Feb. 16. Monday through Saturday, 10 a.m. to 5 p.m., Sunday, 1 to 5 p.m. Call 202-667-0441 or visit www.textilemuseum.org.

A 16th- or 17th-century prayer rug fragment has niches for worshipers and arches that point the way toward Mecca.A prayer rug from the late 16th century, left, may have inspired similar coupled-column rugs, such as this Ottoman parokhet, right, from the 17th century.