SEARSPORT, Maine — To modern eyes, the sea captains’ mansions that dot the Maine coast can seem like elegant emissaries from a more genteel age.

In Searsport, there are a cluster of them, each more stately and with more ornamental decorative flourishes than the last. One of the best-preserved of these is the Captain John P. Nichols House on U.S. Route 1, built in 1865 as an imposing single-family home by a successful retired captain but converted in the last century to the Homeport Inn bed and breakfast and the Mermaid full-service restaurant.

The mansion, and its neighbors, are symbols of a bustling, dynamic time in Maine’s seafaring history, and from the sweeping grounds outside up to the decorated Italianate-style cupola perched at the top, it has quite a story to tell.

Now, the curious and the serious house shoppers alike can take a thorough peek inside the building, which was placed on the National Register of Historic Places in 1983 and which recently was listed for sale for $829,000 by Sotheby’s International Realty. Its story begins with Nichols, a Searsport native who followed local tradition when he went to sea at just 11 years old. At age 47, he built the Italianate mansion and came home from sea for good. Nichols was one of the most financially successful sea captains from Searsport, and at the time, that was saying a lot.

“There was something in the water, I swear,” said Cipperly Good, the collections manager at the Penobscot Marine Museum in Searsport. “There were 200 or so sea captains from Searsport, just in the 19th century. A lot of that is that your father was a sea captain, and you were apprenticed to an uncle or your father’s best friend, to teach you the ropes. But some were also going to sea with their families, or were maybe born at sea.”

In 19th century Searsport, the sea was the primary driver of the economy, and times were good. Beginning around 1800 and lasting until about 1820, Good said, most of the seafaring trade was relatively local. Smaller ships built in Maine brought lumber, fish and other goods down the east coast to growing cities such as Boston, New York and Baltimore. In 1820, the trade got more ambitious. Local shipyards — Searsport was home to four — built bigger schooners that became the long-haul trucks of the time, bringing goods to and from the West Indies, the Gulf of Mexico Ports and across the Atlantic.

“Some families leave Searsport and set up ship-owning businesses in Boston and New York,” Good said. “They’re using their family members and friends from back home to captain the ships.”

By 1840, shipping became more global. Rugged square-riggers built to withstand rough seas started to sail around Cape Horn, at the southernmost tip of South America, to reach the west coast, then ports in China and India.

“There was this brain drain of sea captains,” Good said. “But they came back. And that’s part of the reason why you have these gorgeous houses.”

The captains wanted to build their houses big for a few reasons. They wanted to show off their wealth and they also had to provide room to house large families comprised not just of their own children but often the children of sisters and brothers who were off at sea. Wives often went to sea with their husbands in those days too, Good said. And when they came home, they lived in some luxury.

Nichols was one captain who seemed to spare no expense when he built his home, which has 12 bedrooms, 11 full bathrooms and multiple fireplaces. It features arched, oversized windows, doors flanked by fluted Doric columns and a cupola, which caps the white mansion like a lavish topper on a wedding cake. According to the nomination form for the national register, the decorated cupola adorning the house’s roof is probably Waldo County’s major piece of Italianate-style wood carving.

The form also made note of another important resident of the home, Vice Admiral Carleton Bryant, who was born in 1892 and who served as a rear admiral with the Atlantic Fleet and was important in the Allied invasion of Normandy in World War II. The history seems to impart a special patina to the home, its current owners said.

“It is a beautiful building, and it’s so solid,” said Anita McLellan, who has co-owned the house with her husband, her brother and her sister-in-law for several years.

In the 20th century, times changed for coastal communities in Maine that had thrived in the age of sea captains. Even as the shipyards closed and square-rigged schooners were replaced by more modern vessels, towns like Searsport were still rich in the ornate homes built by sea captains although not, perhaps, in the money that they had brought back to Maine from sea. Family size shrunk and the high cost of heating these houses meant, in many instances, that the sea captains’ mansions of Maine found new life as bed-and-breakfasts or antique shops.

So when McLellan and her family were on the hunt for a restaurant to run back in 2011, the Homeport Inn caught their eye. McLellan and her brother were born in Bar Harbor, and moved to Warren with their parents when they were quite young. The children spent a lot of time in the car driving up and down coastal Route 1 to visit relatives on Mount Desert Island and remembered passing the sea captains’ homes.

“We would see those inns when we were little kids. They always seemed like they were huge, mysterious places to us,” she said, adding that when she was searching online for a likely property, she remembered this one. “I recognized it, of course, and saw that it was a B&B and a restaurant. It worked out. The timing was right. It was an adventure that the four of us took on.”

It has been a good one, she said. Although fellow innkeepers initially told her horror stories about difficult guests, McLellan said she has loved meeting guests from around the world, many of whom have become friends during their stays at the Homeport Inn.

“It’s that kind of a business,” she said. “We’ve had really, really great people and we’ve enjoyed it.”

The beauty of the inn and the luxury of its amenities hasn’t hurt, either. Grand common rooms like the library and parlors have features such as oversized windows, fireplaces, built-in wooden bookcases, fancy wallpaper and ornate chandeliers. Some of the bedrooms have four-poster beds, and all seem large and comfortably appointed.

McLellan said that when she walked into the inn kitchen and saw the large, “gorgeous” butcher block island, the big Sub-Zero refrigerator and other amenities, she practically swooned.

“The inn kitchen is my favorite room. It’s my dream kitchen. I can just bake up a storm in there,” she said. “But all the rooms are so nice. They’re cozy and have a cozy feel.”

One thing that is more goosebump-inducing than cozy, she said, are the ghost stories that seem to be as much a part of old, historic houses like this one as its old-fashioned furniture. In the family’s first summer opening the inn, one guest from England told them that he liked to stay at the Homeport because of the ghosts.

“He said the spirits were there,” McLellan recalled. “I’m pretty much immune, but even I have a couple of stories.”

Perhaps the most deliciously chilling of those features her dog, Cooper, who was her companion at the inn for several months in 2011 while the family was getting ready to open for business. McLellan was living in an apartment on the top floor at the time while her husband stayed home in New Hampshire.

“Every night, about 2 in the morning, Coop would start growling,” she said. “Then he’d go to the kitchen. His hackles were up. He’d just growl until he started full-out barking. A couple of steps led to a door, and he’d look at the door and start barking.”

At first, McLellan figured figured her dog woke up because of nocturnal rodent activity. But as the 2 a.m. incidents continued, she began to wonder.

“It just struck me as really odd that he would do that,” McLellan said. “The mice don’t come out to play at 2 in the morning on a regular basis. It’s just really weird.”

The early morning barking attacks only went away entirely after the family renovated the top floor, she said, adding that ghosts, of course, have nothing to do with the family’s decision to sell the inn.

“My oldest kids have kids, and I want to be a part of my grandkids’ life,” McLellan said. “It’s getting tougher for me to be away from my family or my grandkids.”

She envisions the inn’s next owners as people who have experience in the hospitality business — and, likely, an interest in history. It’s the kind of place where locals have stopped by to share information about its past. That’s how she learned that the huge granite columns that help support the building were quarried locally, and also about one particularly interesting 20th century resident. McLellan was told that Gunnar Hanson, the actor who played Leatherface in The Texas Chainsaw Massacre, had a connection to the inn. His grandparents owned the inn when he was a youngster and the actor lived there for five years, she learned.

“You hear so many stories,” she said.