Two types of pilgrim come to Matsuyama in Shikoku’s northeasterly Ehime Prefecture: Buddhists and bathers.

The former will be more than halfway through the circuit of 88 temples devised by Kobo Daishi (774-835), founder of Japan’s esoteric Shingon Buddhist sect, for the remission of mankind’s 88 sinful desires. The latter know a faster way to mortal happiness — a soak in the waters of Matsuyama’s Dogo Onsen.

Dogo Onsen in Matsuyama is said to be older than Buddhsim itself.

The bath actually claims to be older than Buddhism itself. The founding legend holds that 3,000 years ago, in the mythical “Age of the Gods,” a white heron bathed its injured leg in the hot spring and was instantly cured.

The building, dating from 1894, is modeled along the lines of a three-story castle, with a white heron perched on its topmost turret. The upper floor contains a bath reserved for members of the Imperial family, the Tama-no-yu (Bath of the Spirits) is on the second floor, and the main public bath, the Kami-no-yu (Bath of the Gods), is on the first floor.

The first-floor women’s bath is dominated by a vast sunken granite basin. Segregation of the sexes, standard practice now, was rare until the mid-19th century when early foreign diplomats were scandalized by the Japanese custom of mixed bathing, leading the Meiji leaders to import Western prudery along with technology and parliamentary democracy.

In the center, a pedestal bearing the figures of Okuninonushi-no-Mikoto and Susano-no-mikoto, the eponymous deities, spouts water directly onto the shoulders of those waiting eagerly beneath. The scene is pure Sir Lawrence Alma-Tadema decadence (see his paintings “The Baths of Caracalla” of 1899, or “A Favourite Custom” of 1909) — until the steam clears a little and you notice the advanced age of many of the bathers.

Dogo Onsen is not for the faint-hearted. The slightest breach of ofuro etiquette elicits disapproving looks from regulars — to the extent that I, the only foreigner, drew less attention than a pair of bleached-haired beauties who clearly didn’t have a clue and giggled about that fact loudly in ringing Osaka accents.

Women sit in twos and threes around the rim of the tub, gossiping and calling over to friends. Elderly women who in the West would be content with a twice-weekly bed bath from a visiting nurse may climb unsteadily in and out of the water, but display remarkable vigor once settled: one does calisthenics, another beats her neck and joints with a stout stick, a third is almost entirely submerged under the steaming spout, eyes blissfully closed.

The scene is a vivid picture of what the social world of public bathing in Japan was once like. It is a world that is increasingly hard to find, and Dogo Onsen has become for its Japanese visitors a symbol of their past, a little piece of history come alive.

Adding luster to the nostalgic appeal of Dogo Onsen is its most famous former bather: the hero of Natsume Soseki’s “Botchan” (1906). Soseki (1867-1916) is best known in the West for “Wagahai wa Neko de aru (I Am a Cat)” (1905), a wicked satire of Meiji intellectual life, but “Botchan” — about a naive young teacher in rural Shikoku — is the firm favorite among Japanese.

The title character’s social life revolves around his evening trips to the baths, and the small-town dramas that fill Soseki’s pages spring from things seen, heard and misunderstood on the way.

During the breathless decades of Japan’s postwar modernization, when it must have seemed that traditional ways of life were fast disappearing, nostalgia became a national craze. “Botchan” was filmed no less than five times — in 1958, 1966, 1968, 1975 and 1977. Photographs from the various movies are displayed along the corridors of Kami-no-yu.

There is also a “Botchan” room on the third floor, filled with Soseki memorabilia. But unlike other towns that capitalize on celebrated literary associations, Dogo Onsen’s popularity needs no recourse to its fictional five minutes of fame.

On my last night at the hot springs I decided to upgrade to the Tama-no-yu, which comes with the choice of recuperative refreshments afterward in a communal tatami hall or private, third-floor chamber.

The latter option is an indulgence not to be missed. In my heron-patterned yukata, I sat on the balcony threshold savoring tea and mochi. Steam rose from hidden vents.

To my left was a lofty, lit room, invisible from the street below, that could only be the Imperial bathhouse. Down below I heard the clatter of geta, as visitors shopped for souvenirs in their yukata and hakama. And over the roof tiles, bright in the blue night sky, flashing red katakana advertised a pachinko parlor.

The outside world may have changed, but Dogo Onsen, happily, shows every sign of being set in its 3,000-year-old ways.

In line with COVID-19 guidelines, the government is strongly requesting that residents and visitors exercise caution if they choose to visit bars, restaurants, music venues and other public spaces.