DHAKA, Bangladesh — A prominent Bangladeshi-American blogger known for speaking out against religious extremism was hacked to death as he walked through Bangladesh’s capital with his wife, police said Friday.

The attack Thursday night on Avijit Roy, a Bangladesh-born U.S. citizen, occurred on a crowded sidewalk as he and his wife, Rafida Ahmed, were returning from a book fair at Dhaka University. Ahmed, who is also a blogger, was seriously injured. It was the latest in a series of attacks on secular writers in Bangladesh in recent years.

A previously unknown militant group, Ansar Bangla 7, claimed responsibility for the attack, Assistant Police Commissioner S.M. Shibly Noman told the Prothom Alo newspaper.

Roy “was the target because of his crime against Islam,” the group said on Twitter.

Roy was a prominent voice against religious intolerance, and his family and friends say he had been threatened for his writings.

The United States strongly condemned what it called Roy’s “brutal murder.”

“This was not just an attack against a person, but a cowardly assault on the universal principles enshrined in Bangladesh’s constitution and the country’s proud tradition of free intellectual and religious discourse,” State Department spokeswoman Jen Psaki told reporters in Washington.

About 8:45 p.m. Thursday, a group of men ambushed the couple as they walked toward a roadside tea stall, with at least two of the attackers hitting them with meat cleavers, police Chief Sirajul Islam said. The attackers then ran away, disappearing into the crowds.