DARTMOOR, England - We sought a break from the bustle of London at a remote cottage perched on the edge of Dartmoor - the legendary, perhaps haunted, bog in southwest England that achieved fame in stories such as The Hound of the Baskervilles.

Our visions of long walks across the sun-dappled moor were washed out by two weeks of rain following the wettest spring on record, which, for England, is saying something. (It wasn't until the end of our stay that we learned at a local tavern that Dartmoor is one of the soggiest places in the entire country.)

Determined to "keep calm and carry on" in the finest British tradition, we donned our raincoats and stiff upper lips, and explored the sodden countryside. The visitors center at Dartmoor National Park optimistically posted the weather forecast as "brightening," which basically means "less clouds" - as good as it gets around here.

Perhaps the forecast was really more of a wish. As we hiked along a narrow country path, the fog enveloped us like a damp cotton comforter and reduced visibility to arm's length. Forget pea soup, this fog was more opaque than the can it came in. In the murky atmosphere, we tried to erase from our minds the legend of the hairy beast that haunts the moors, carrying off wandering travelers.

After a mile or so, a moss-covered, stone Gothic building broke through the mist. We could just make out the letters "Dartmoor Prison" and, somewhat incongruously, a "Welcome visitors" sign. We had stumbled upon the only prison museum in England that is still attached to a working prison. We didn't realize that it also contained a little-known fact related to American military history.

As we entered the museum, curator Brian Dingle recognized our accents and said, "I bet you didn't know American prisoners of war were held here." We immediately thought back to World War II, and wondered why American soldiers would be imprisoned by the British. But we were thinking of the wrong war, and the wrong century.

Built in 1806, Dartmoor Prison housed prisoners of war who had been held on disease-ridden prison ships just off the coast. Among them were captured American soldiers and sailors from the War of 1812, alongside French prisoners from the Napoleonic Wars. There was one stark difference between the two groups; since the former colonists were considered traitors to the British Crown, they were treated worse than the French.

The Americans started arriving in 1813, leading to severe overcrowding. The cold, damp conditions bred disease. One American prisoner of war described the setting as "an incredibly bleak place. It is either rainy, snowy or foggy the entire year round."

The exhibits convey the history of the prison, alongside a gallery devoted to prisoners' works of art. A section in the darker recesses displays contraband confiscated from the prisoners, including an escape rope assembled from bedsheets tied to a grappling hook, which was found quite recently. Given the dreary climate, it's understandable that a prisoner's thoughts would turn to escape.

On our way out of the museum, the obliging curator popped up again and declared, "You must see the church up the road - after all, your people helped build it."

Another secret of the fog-shrouded moor was about to be revealed.

If "idle hands are the devil's workshop," the prisoners were put to use in a somewhat more pious endeavor. The Americans and French worked side-by-side building the Church of St. Michael and All Angels. Built from locally quarried granite, it sits atop one of the highest elevations of any church in the country, and bears the weatherworn marks of its windswept setting.

When we approached the churchyard, it was so cloaked in fog that only the barest outlines of the chapel and surrounding cemetery were visible. We felt as though we had stumbled onto the set of a horror movie. The sequential appearance of each row of crumbling headstones, rising out of the haze like ranks of soldiers, acted as spectral signposts pointing the way to the narthex. The chills set off as we walked through the cemetery were alleviated a bit in the church.

At the only church in England built by American prisoners, amends have been made in the form of the stained-glass East Window, a tribute to the American prisoners of war who died in captivity at Dartmoor Prison. Depicting scenes from the Passion of Christ, it was donated a century ago by the "National Society of United States Daughters of 1812," a group dedicated to preserving the memory of those who fought in the war. In the chilly sanctuary, we lit votive candles and prayed for the 271 American soldiers who are buried nearby, some in the church cemetery and others behind the prison.

We walked out of the church and, as if on cue, the fog lifted and the sun made a glorious appearance. After a few days of doom and gloom, it took our eyes some time to adjust to the blinding sunshine.

The church basked in the warm glow, grateful for a chance to dry out and put on a better appearance.

Although its origins were grim, it has risen above its past to provide a place of solace and respite for those in need of it and a refuge for travelers. Today it stands as a fitting memorial to the captured soldiers, many never to return home, who built it.