When the four newly minted Philadelphia police officers first took their posts, they were gawked at and taunted.  Several of their colleagues even quit in protest of their appointments.

But these men had survived much worse — slavery in one case, service in the Civil War in another. They would survive this, too.

Their time as Philadelphia's first black police officers is recalled in Black in Blue, a self-published book by former Philadelphia Police Inspector Arthur Matthews, who himself made history as the city's first black captain of the Homicide Unit. Matthews traces the history of black police officers in Philadelphia from those first four to the current top cop, Commissioner Richard Ross.

Matthews, 87, calls his labor of love "more of a scrapbook than a history book," and, with all the photos, newspaper clippings, and letters he included, it reads like one, too. He and his co-researcher, former city officer Ben Scott, spent years digging through public archives and the personal collections of their colleagues to create a tribute to the black police officers who were pioneers on the force.

"It wasn't easy. The information is scattered, and some of it you bump into by luck," Matthews said. "Black history is sparse in this country. It's all documented somewhere, but not together. It's only when you put it together that you have a story."

Matthews hopes to distribute his book free to schools, clubs, community groups and, especially, members of the police force, he said.

While Matthews' book is about the past, it also puts a historical context on current events. For example, he writes about how in 1968, John Harrington, then president of the Philadelphia FOP, endorsed segregationist Gov. George C. Wallace of Alabama for president, and more than 100 officers with the Guardian Civic League — an organization that represents black cops in the city — protested the decision.

Last year, when the national FOP endorsed Donald Trump for president, which the local Lodge 5 supported, the Guardian Civic League again publicly protested the endorsement, because Trump led a "racist" campaign of "bigotry," league president Rochelle Bilal said.

"If you don't know history, it will repeat itself," said Matthews.

In 1961, Matthews became a city cop, and after just eight years on the force, he was chosen to head the Homicide Unit. He retired as an inspector in 1980 and lives in the River Park section of West Philadelphia.

During his time on the force, black officers worked to bridge the gap between the police and the community, Matthews said.

"I still tell officers today that their job is to protect by improving the community, not just to arrest," he said.

While researching his book, what surprised Matthews the most were the stories of the city's first four black police officers.

According to his research, the black community in Philadelphia campaigned to get black police officers on the force for nearly 10 years.

"The black community rallied for black police officers because they didn't think the white police officers were protecting them," Matthews said.

Samuel G. King promised during his campaign for mayor to appoint black officers if elected, and did so in August 1881, a few months after taking office.

"Mayor King said to a reporter that his object in appointing colored men on the police was to recognize a principle," an 1881 Inquirer article about the officers' appointments said. "The Constitution makes the colored man and the foreigner citizens, and it would be unfair for him to discriminate against any set of citizens."

But not everyone felt the same way.

"Some whites said they would not submit to these officers' authority and some white cops quit rather than work with them," Matthews said. "When they first hit the street, it was like an anomaly. People would stand and stare, and they were met with hostility."

Among those trailblazing  officers were Louis W. Carroll, 26; Richard Colwell, 24; and Charles K. Draper, 40. During the Civil War, Draper had served as a Navy seaman aboard the Constellation, which intercepted slave ships leaving West Africa, according to Matthews' book.

On his first day in uniform walking a beat, Draper was followed by a mob of people, some of whom yelled defamatory remarks. But he kept his cool, according to reports.

"I pay no attention to this tom foolery," he was quoted as saying at the time. "I expected it. I made up my mind to let it go into one ear and out the other."

Former slave Alexander G. Davis was also among the first black Philadelphia cops. After emancipation, Davis attended Lincoln University and obtained a law degree from Howard University. Yet he was denied entry to the bar, presumably because of his race, said Matthews, who would like to see Davis admitted to the bar posthumously. Davis was working as a teacher when he was chosen to serve as a cop.

"These were our heroes," Matthews said. "We stand on their shoulders."

Those interested in obtaining more information about Matthews' book may email him at AJMatt1997@comcast.net.