An apparent pipe bomb was found at a home in southern Brooklyn on Wednesday, police sources said.

It wasn’t immediately clear if the device was active or inert.

One person was taken into custody, according to a source.

The “cylinder-type device” was found inside an apartment building in Gravesend on W. Second St. near Avenue Y when police executed a search warrant just past 11 a.m., the source said.

The search warrant is part of a larger ghost gun investigation, sources said.

The device was removed by the NYPD Bomb Squad and taken to Rodman’s Neck to be tested.