Camden as seen from Mount Battie.

During the mid-1800s, Maine was seen as one of the last steps on the road to freedom for many African-Americans trying to escape slavery through the Underground Railroad.

Through inland and coastal routes, Mainers banded together in secrecy using a system of safe houses, tunnels and codes to help escaped slaves cover the final stretch into Canada.

“People haven’t treasured the bravery of their ancestors who took it upon themselves to help these people escape slavery at a possible cost of their houses, life and fortunes,” Maine author Mark Alan Leslie said.

Just how these Mainers pitched in to form the secretive network that was the Underground Railroad is the topic of a lecture Leslie is giving Tuesday at the Camden Public Library as part of the library’s annual month-long history series.

Leslie of Monmouth has written numerous works of fiction rooted in Maine history. For his book “True North: Tice’s Story,” Leslie researched the role that Maine and its residents played in helping African-Americans escape slavery.

The Underground Railroad consisted of an elaborate network of people and places to help hide slaves and get them to free states or Canada.

Leslie said some routes went south into Mexico, but the majority of the routes on the Underground Railroad focused on moving slaves north into Canada, with some of those routes taking these slaves through Maine.

“Once they hit Portland, they went up the coast or they went inland,” Leslie said. “They were taken by boat sometimes or by their hosts families, people who were called conductors.”

Established anti-slavery societies existed in Lincoln County, Waldo County, Penobscot County and on Mount Desert Island, Leslie said. The anti-slavery involvement also “heavily included people from Camden, Rockland and Belfast, all the way [south] through Brunswick.”

While some Mainers helped slaves to freedom, other Mainers wanted to cash in on the reward with their capture, Leslie said. Due to the Fugitive Slave Act of 1793, and the Compromise of 1850, even in free states, officials were supposed to help slave catchers in their pursuit of escaped slaves.

“People who [helped slaves] were risking heavy fines and time in jail,” Leslie said. “Up here in Maine, people who were pro-slavery figured they could get money from the slave owners for turning them in. You really had to [be a part of the Underground Railroad] in secret because your neighbor might be turning you in because they wanted a few bucks in their pocket.”

Keeping the passage of escaped slaves secret, Leslie said, resulted in an intricate system of ways to move these people from one safe house to another and then to Canada.

In the southern coastal area, centered around Brunswick and Topsham, Leslie said there was believed to be a system of tunnels connecting safe houses where the escaped slaves could be moved without being seen.

Going up the coast, as well as inland in Augusta, Bangor and Brewer, safe houses were sometimes marked by a white chimney with a black ring at the top, Leslie said.

To communicate with the escaped slaves and other “conductors” on the Underground Railroad, quilts hung on front porches often served as code, according to Leslie. Depending on a particular pattern on a quilt, people “riding” the Underground Railroad could tell if the house was a safe house, or which direction they should head, or even be warned about a slave catcher in the area.

Since much of this history has been lost, Leslie said it’s possible people could be living in a former safe house without knowing it.

The lecture on Maine’s connection to the Underground Railroad begins at 7 p.m. Tuesday in Camden.

Follow the Bangor Daily News on Facebook for the latest Maine news.