BIDDEFORD — It’s still dark outside when Reilly’s Bakery opens at 6 a.m. Most of the other businesses are closed, and Christmas lights are still twinkling in the trees that line Main Street.

Michael Reilly has been here since 4 a.m. The doughnuts are done. Reilly’s son-in-law is baking bread, and the bakery’s assistant is making holiday ginger cookies. Reilly, wearing sneakers and a brown T-shirt with Bermuda shorts, stands at the 85-quart mixer, working on pie dough before moving on to puff pastry and cinnamon twists.

This has been Reilly’s routine for the past 50 years, six days a week: Up at 2:45 a.m., in the bakery by 4 a.m., home by noon for lunch and a nap. He has been known to fall asleep with a hamburger in his hand.

That demanding schedule is about to change. On Dec. 29, his 65th birthday, after the pork pie Christmas rush, Reilly will put away his rolling pin at precisely 10 a.m. – the time he was born – and retire from full-time work at the family baking business he has owned since 1983. His daughter and son-in-law, Elizabeth and Kevin Hussey, who represent the fourth generation, will be taking over management of the old-fashioned bakery well-loved for its maple cream doughnuts, which sell for $1.25 apiece. They’ll celebrate with an open house retirement party from 1-4 p.m. on Jan. 2.

Reilly says that when his father, Edward Reilly, died at 93 in May, it mentally opened the door to the idea of leaving the only job he has ever had.

“Last year I had a couple of hips replaced, so I’m wearing out,” he said. “I’m getting tired.”

But sometimes it’s hard to let go. Even as he’s looking forward to a spring trip to Aruba with his wife and is pondering what kind of volunteer work might come next, Reilly plans on coming into the bakery three days a week. He swears he’ll be out the door by 8:30 a.m. instead of noon, but his daughter is skeptical.

“It will probably be more like six” days, she said, while on break from making creme rolls. “My mother will be kicking him out on a daily basis.”

The bakery celebrated its 100th anniversary just a few years ago. Mike Reilly’s grandfather and his grandfather’s brother-in-law, Bob MacFarlane, started it in 1910. It was taken for granted when Reilly started working there as a teenager, long after MacFarlane left and it became a family business, that he would one day be handed the reins.

Employees walk under a big white-tile arch to get to the back of the bakery, where all the action is. Hussey’s baguettes are baking in a huge oven with six shelves that turn like a Ferris wheel. “We don’t time anything,” Reilly said. “We just go by color.”

Vienna rolls ($3 a dozen) are rising in a proof box. Andrew Paradis, the assistant, scoops ingredients for the gingerbread cookies ($1.80 for 1 large gingerbread man) out of galvanized metal bins that date to the 1940s, when Reilly’s father modernized the bakery and replaced a lot of equipment. The bins’ labels read like a Christmas cookie recipe: mace, ginger, cinnamon, nutmeg.

Paradis is following the ginger cookie recipe in “the family Bible” – a thick book, discolored from decades of use, that contains most of the recipes that have been passed down through the generations.

“If somebody comes in, they can taste something they had at 5 years old, and it’s the same,” Reilly said. “Once recipes have been tried over the years and perfected, we don’t change a thing.”

He is not worried about the book being lost or stolen. Even though he says the recipes haven’t changed, there are tweaks in some that only the family knows about, making it hard to copy them. And besides, he said while pointing to his temple, “we do it every day, so most of it is memorized.”

The bakery is known for its hot cross buns ($9 a dozen), made during Lent, and for the buns that the Clam Shack in Kennebunk uses to make its award-winning lobster rolls. The chocolate-covered doughnuts, on sale every Friday, are a year-round customer favorite. (Reilly can’t resist an occasional chocolate-covered doughnut, especially when it’s still warm, but has outgrown his teenage habit of eating everything he bakes “with two hands.”)

Beginning the Friday before Christmas, the bakery takes orders for pork pies, a favorite holiday food in this town with a strong French-Canadian heritage. The recipe comes from Reilly’s French grandmother, who immigrated here from Canada, and the ground pork comes from the local butcher because Reilly likes it lean. On pork pie baking days, Reilly starts his day even earlier, arriving at the bakery by 2:30 a.m.

CAMARADERIE, INCREASED COMPETITION

Customers don’t start appearing in any great number until about 7 a.m. But every morning around 6:30, you’ll find John Boucher sitting at a small table for four, waiting for his friends, Don Andrews, Gerard Lavoie and Roland Ruel. Ruel can’t make it on this Tuesday morning, but the other three show up to drink coffee, eat doughnuts and trade fist bumps and banter with their friend Reilly – who calls the men his “adopted cousins” and says he will probably join them after he retires.

Boucher, 68, has been coming to Reilly’s his whole life.

“My family would always get stuff here,” he said. “It’s a nice place to come in the morning. It’s quiet, and you know everybody.”

On the wall across from their table, old photos are on display, including one dated March 1916 that shows a group of men in ties and dress coats, hats in hand, standing in front of the bakery. The caption is: “Third Annual Outing, Doughnut Club.”

Reilly says things haven’t changed much at the bakery over the years, except everything is done on a smaller scale. Back when he first started, six full-time bakers made 1,800 pork pies during the holidays; this year, the three bakers and their assistant will make 500 to 600 pies.

The biggest challenges since 1965, Reilly said, have been the rising cost of ingredients and increased competition from places like Dunkin’ Donuts and grocery store bakeries. Fifty years ago, it wasn’t unusual to make cakes for a half-dozen Saturday weddings.

One of those cakes was for Maggie Haskell Buzzell, who now lives in Murrells Inlet, South Carolina. In the early 1960s, she was “a little Hollis Center girl” who moved in with her brother in Biddeford one summer so she could work at a local shoe store.

“I would walk by Reilly’s Bakery and, oh my gosh, they had such beautiful wedding cakes and things in the window,” she said. “I used to say, ‘If I get married, I’m going to have my wedding cake from Reilly’s Bakery.’ ”

That summer, she met her future husband. They got married in August 1965, the same year Mike Reilly joined the bakery, and ordered their wedding cake – a white tiered cake decorated with roses and wine glasses.

Today, Reilly said, the bakery is lucky to get three wedding cake orders a month.

MODEL FOR THE NEXT GENERATION

Like her father, Elizabeth Hussey started working at the bakery when she was a teenager. She used to come in so she could spend more time with her father, and after a while he put her to work.

Hussey says she admires the way her father “just doggedly stayed at it” through decades of recessions and increased competition. She and her husband hope to introduce some new recipes over time, including savory baked goods.

Kevin Hussey, who worked for the bakery from 1990 to 2000, then left for seven years, is looking forward to becoming a part of the family history. “I love doing this,” he said. “I always have. I jumped at the chance to come back and do this job. Mike has always been my mentor. I learned everything I know about baking from him.”

Reilly is confident he’s leaving the bakery in good hands. And he’s already working on training the fifth generation – his two grandchildren.

“They’re my taste testers,” he said.