A 3-story loft building in Williamsburg that had once been a factory and was later home to a collection of artists has hit the market for $52 million.

The building, at 151 Kent Ave., sits between North Fourth and North Fifth streets in the northern portion of the neighborhood, which has been rapidly transformed over the past decade by a rezoning and burst of development activity along the waterfront. The 56,550-square-foot brick structure, which contains 46 fully leased loft units, sits a block from a ferry stop along the East River and two blocks south of East River State Park.

“Loft buildings of this scale are rarely available in North Williamsburg,” Cushman & Wakefield’s Brendan Maddigan, who is marketing the property with colleagues Ethan Stanton and Michael Gigante, said in a statement.

The former factory was initially converted into loft-style residences by artists in the late 1990s, before it came under the purview of the Loft Law, which sought to bring the units up to code. More recently, at least part of the property was leased to a co-living company called Pure House, though the firm eventually closed up shop at the location and the owner rented the loft units more traditionally.

The building comes with a basement and 34,000 square feet of air rights that could be used for an expansion. It also has 200 feet of frontage along Kent Avenue that Cushman suggested could be converted to lucrative retail space.

The listing is hitting the market at an uncertain time for Williamsburg and much of northern Brooklyn. In April the Metropolitan Transportation Authority plans to begin a 15-month shutdown of the deteriorating East River tunnel used by the L train. The repair project has sowed fears in the real estate community of softening demand and prices in the neighborhoods along the subway line. The city has unveiled a plan to beef up bus and ferry service.

The de Blasio administration is also planning a streetcar that would run along Kent Avenue in front of the property, though officials have been mum on the project’s progress lately. It faces huge price obstacles, hinging on how much subsurface infrastructure must be moved.