The city of Alexandria plans to buy and restore Freedom House, the site of one of the nation’s most notorious pre-Civil War slave pens, and expand exhibits inside the building that showcase its cruel history.

City officials announced the $1.8 million purchase agreement Monday after months of negotiations with the Northern Virginia Urban League, which has owned the 1812 brick rowhouse at 1315 Duke St. since 1996.

Mayor Justin Wilson (D) called the building’s preservation “vital . . . to connect the stories of our past to our present-day conversation about race and equity, and ensure we are telling a broader, more candid account of Alexandria and our nation’s history.”

Between 1828 and 1836, the property served as headquarters for Franklin and Armfield, at the time the richest and most successful slave-trading business in the United States. Other slave-trading firms operated there in later years, until Union troops arrived in Alexandria in 1861 and found a lone black man chained by the leg in the basement.

Historians say as many as 50,000 enslaved Africans passed through the depot on their way to servitude in the Deep South. After being herded off boats at Alexandria’s port and marched to the property, they were held in the dingy basement or in cells behind the house, then forced to walk in chains or sail on packed ships to bondage, primarily in Mississippi and Louisiana.

The local Urban League was praised for saving the four-story rowhouse from oblivion in 1996 when it bought the property and created a small basement museum that includes shackles and recordings of slave narratives.

But upkeep proved too much for an organization that focuses primarily on scholarships and economic self-reliance, parity, and civil rights for disadvantaged communities. In the summer of 2019, heavy rainstorms flooded the basement with three inches of water, damaging the flooring and some exhibits.

The league put Freedom House on the market for use as a commercial or residential property, with an asking price of $2.1 million.

In October, Urban League board chair Diane McLaughlin said the Alexandria government was interested in taking over the building. Wilson said the city wanted to keep the property from falling into private hands, and City Manager Mark B. Jinks predicted a deal by year’s end.

The Alexandria City Council will officially vote whether to buy the building in February. Last month, Virginia Gov. Ralph Northam (D) included $2.44 million in his proposed budget to help restore the property and expand the museum to the first and second floors.

Wilson said the city plans to seek out partners to help with those efforts.

McLaughlin, in a statement Tuesday, declared the league was pleased to put the house in the city’s hands to make sure its story continues to be told. The organization will be allowed to keep its offices in the building for five years, city officials said.

For the past year, the city and the league have jointly operated the museum, although the Urban League retained ownership.

Alexandria provided a $63,000 interest-free loan to stabilize finances in 2018, established an entrance fee and sent city historians to operate weekend tours.

A memo outlining that loan for the City Council said: “Possible loss of this site to private ownership would deprive historians, and those interested in slave history the understanding of an important aspect of our Nation’s and City’s heritage. This site should remain accessible to the public, so what was once a place of horrors may be held for the public trust.”

The Freedom House is open to the public on Fridays and Saturdays from 1 p.m. to 5 p.m. For more information, its website is alexandriava.gov/FreedomHouse