It is history that was more or less hiding in the midst of a busy modern-day city.

In the process of excavating for its port revitalization project, Rio de Janeiro is discovering forgotten pieces of its history — its black history.

When a street was dug up in central Rio, historians were expecting to find remnants of the Imperial Wharf that was built to greet the arrival of a bride for Dom Pedro II in the 1800s. Even though a street covered the site, there was a column, placed in 1906, marking the spot.

But unexpectedly another wharf was discovered under the Imperial Wharf — the one where Africans were brought to the city to be auctioned off as slaves.

In 1811, Rio’s slave market was moved from the center of the city to the less conspicuous Valongo Street and the dock with its irregular stones hand-hewn by the Africans themselves became the heart of the city’s slave trade. Though it only operated for about 20 years, an estimated 500,000 slaves arrived at the pier.

But in 1843, neat, rectangular blocks were laid over the top of the Valongo pier and elegant statues were brought in to make the wharf worthy of receiving Princess Teresa Cristina Maria de Bourbon, fiancee of Dom Pedro II — future emperor of Brazil, and it was rechristened the Imperatriz Wharf.

When the original coastline was filled in to expand the port in 1911, the Imperatriz Wharf and the history underneath were forgotten amid the hustle and bustle of urban life.

Now, the street that once covered the two wharves has been rerouted and they are part of an open, protected monument. The Porto Maravilha exhibit center offers guided tours to the wharves, the nearby Hanging Garden of Valongo and an old guardhouse.

Nearby is the cemetery where the bodies of those slaves who died before they were auctioned off were tossed, and old Valongo Street where stores that sold the accoutrements of the slave trade and the fattening houses — large sheds where newly arrived Africans were induced to gain weight to increase their market value — were once located.

“Many Cariocas (Rio natives) don’t even know the history of these streets,” said Raul Melo, a historian whose company Rios de História now offers tours that include the African heritage sites.

But thanks to the efforts of black activists, historians, archaeologists and architects, more Rio residents are beginning to learn their city’s history.

The Valongo complex has been nominated for inclusion on the UNESCO World Heritage List — amid concerns that the rush to redevelop the port area may be at odds with preservation of the African heritage finds and future discoveries.

The effort to revitalize downtown Rio began in 2009 and as it continues, other black history sites are being revealed and introduced to a country that only relatively recently has begun to esteem its black history.

“This is not only very important for Rio but for the whole country — uncovering the Afro-Brazilian heritage,” said Washington Fajardo, president of the Rio World Heritage Institute.

Around 51 percent of Brazilians defined themselves as black or brown in the 2010 census. Yet, despite Brazil’s long-held myth of “racial democracy” — that the mixing of races made the concept of racism obsolete, Brazilians of African descent haven’t enjoyed the economic and social opportunities of other Brazilians.

However, in the past decade there has been increased emphasis on Brazil’s shared history with Africa as well as on forging new trade and cultural ties with the African continent.

Former President Luiz Inacio Lula da Silva made 12 African trips and visited 21 countries. President Dilma Rousseff also has emphasized leaving a “legacy to Africa” in the form of technical transfers and other cooperation. Between 2000 and 2010, Brazil’s trade with Africa increased from $4.3 billion to $20.4 billion and Brazil also more than doubled the number of its African embassies during the decade.

The turning point in government involvement in the question of race, however, can be traced to the previous administration of President Fernando Henrique Cardoso, said Kia Caldwell, an associate professor at the Department of African, African American and Disaspora Studies at the University of North Carolina at Chapel Hill.

“He publicly acknowledged that racism existed in Brazil. That was really the start of the government being involved,’’ she said.

Encouraged by Brazil’s black movement, Brazil passed a law in 2003 making the teaching of Afro-Brazilian and African history and culture compulsory in public and private schools, opening the door for new generations of Brazilians to learn about the transatlantic slave trade, which flourished from the 16th century to 19th century.

There is also a movement to upgrade black history teaching materials in public schools and universities, said Kenneth Dossar, a professor of African-American Studies at Temple University and director of the school’s Brazil program in Salvador, Bahia.

Many universities in Brazil also began introducing affirmative action programs in the early years of the last decade, and in 2012, Brazil passed a law giving universities four years to allot half their admission spots to graduates of public schools, a move that greatly enhances the chances of admission for African-descent students in predominantly black or mixed-race states.

Still, educational gaps between black/mixed race people and white Brazilians remain large. “I think affirmative action has certainly been effective, but that doesn’t mean there aren’t problems,” said Caldwell, who has studied race and gender in Brazil.

Now, slowly, a history of blacks’ earliest days in Rio de Janeiro is being revealed and people are paying attention.

An estimated 3.5 million to more than 3.6 million Africans arrived in Brazil as slaves, who supplied manpower for sugar plantations, mines and coffee plantations. Another 1.5 million may have perished en route to Brazil.

In 1850, the slave trade was outlawed, but not slavery itself, which continued until Brazil abolished it in 1888. It was the last nation in the Americas to end slavery.

After slavery was abolished, many freed slaves, attracted by cheap rents and work on the docks, settled in the Saude neighborhood and the area became known as Little Africa.

The roots of two of Rio’s most cherished traditions — samba music and Carnival — can be traced to Little Africa.

In 2011, the city passed a statue creating a curatorial work group tasked with drafting guidelines to recognize and protect the port area’s African heritage.

Six sites, including the Valongo Wharf, have been designated part of the African heritage historical and archaeological circuit in the port neighborhoods. The others are:

• Cemetery of the New Blacks — It was rediscovered in 1996, when a couple began refurbishing their home in the neighborhood of Gamboa and started to unearth bones. The cemetery takes it name from the newly arrived slaves, who weakened from their trans-Atlantic passage, died before they could be sold.

Bodies of these new blacks were unceremoniously dumped in mass graves between 1769 and 1830 near the slave-trade complex where they were held in warehouses awaiting sale. There are believed to be about 6,000 burials at the site.

• Pedra do Sal — This is the gigantic rock slaves traversed carrying sacks of salt from the wharves to the neighborhoods above. To make their work easier, they chiseled steps into the stone.

But the square next to it is also historic. Stevedores used to gather at Largo São Francisco da Prainha to sing and dance, creating the first improvised Carnival parades and parties. It’s known as the birthplace of samba and now it’s home to Escravos da Mauá (Slaves of Mauá) , one of most famous blocos, or street parties, during Rio’s Carnival season. The square also has become a magnet for samba enthusiasts the last Thursday of the month.

• Hanging Garden of Valongo — In the early 20th century, in an effort at urban beautification in the area where the fattening houses were once located, the Hanging Garden of Valongo was created on a rocky promitory. But it was abandoned for many years and became a haunt for crackheads. The gardens and the old Warden’s House were restored using historic photos, said Fajardo, and the statues that once graced the Imperatriz Wharf were moved here.
• Largo do Depósito — This was the site of the slave market that was moved from the tonier Praça XV.
• José Bonifácio Cultural Center — It opened on March 14, 1877 as the first public high school in Latin America and resulted from an order from Dom Pedro II to educate the poor of the port region. The center closed in 1977 and the building has been converted to the Gamboa Municipal Community Library.

African necklaces, small symbolic coins, representations of orishas (deities in African religions), toothbrushes and other objects of daily use have been uncovered at the Valongo complex.

“The presence of the sacred and the sense of ancestry found in this place has turned Valongo into a symbolic landmark for social movements promoting racial equality,’’ notes a UNESCO statement.

“For me, the most important thing is to find the cultural value of an area,” Fajardo said.