BUENOS AIRES — President Obama expressed regret on Thursday for the failure of the United States to acknowledge the brutal repression and atrocities that took place during Argentina’s “dirty war” in the 1970s and ’80s.

“There’s been controversy about the policies of the United States early in those dark days,” Mr. Obama said at the Parque de la Memoria, a monument to the war’s victims, where he attended a ceremony for the 40th anniversary of the 1976 military coup that began the Argentine dictatorship.

The United States “has to examine its own policies as well, and its own past,” Mr. Obama said, adding, “We’ve been slow to speak out for human rights, and that was the case here.”

The president’s remarks came after he toured the memorial with President Mauricio Macri of Argentina, walking beside a hulking gray stone wall engraved with the names and ages of 20,000 victims — and 10,000 blank spaces for those who have yet to be identified. Mr. Obama announced this week that he would begin a declassification effort to unseal secret military and intelligence files that could shed light on the fates of some of those victims, as well as what the United States knew about human rights violations that took place during what Mr. Macri called “the darkest period in our history.”