HAMTRAMCK, Mich. — It was 5:45 a.m. and 10 degrees — before the sunrise, before the first call to prayer sounded from the city’s mosques — and already the Fat Tuesday line had spilled out the bakery’s doors, onto the street, past the pizzeria, around the corner.

The reward at the end of the frigid wait: a box of paczki (pronounced “PAWN-chkee”), the doughy Polish pastries filled with custard or fruit or, for the less tradition-bound, stuffed with Cocoa Puffs cereal.

Paczki Day has been a pre-Lent pastime in Hamtramck for generations, dating back to when most residents were from Polish families who came to this roughly two-square-mile enclave, which is almost completely encircled by Detroit, seeking jobs in the auto industry and a place to speak their native language.

Hamtramck’s transformation in recent decades is well documented and obvious. Storefronts now display signs in Arabic or Bengali. A main road was given an honorary name, “Bangladesh Avenue.” And after the 2015 election, Hamtramck’s City Council became the country’s first with a Muslim majority, a milestone that drew unwanted media attention and critical social media posts from ex-residents who left decades ago.