DHAKA, Bangladesh — A woman and a man suspected of being militants blew themselves up on Saturday on the outskirts of this city, the capital, during a police raid on an apartment believed to be a den for a militant group, the police said.

“This is the first incident in the country where a female militant committed suicide” by detonating explosives on her body, said Masudur Rahman, deputy commissioner of the Dhaka Metropolitan Police.

The police cordoned off the apartment building at 2 a.m. on Saturday, and two women with two children surrendered, said Yousuf Ali, another police official. The women, the police said, were married to members of the militant group, Jamaat-ul-Mujahedeen Bangladesh, who are suspects in a series of attacks against civilians in recent years.

Hours later, another woman left the building with a 4-year-old girl and set off two grenades. The woman was killed, and the child was wounded by shrapnel from the explosives. She was being treated at Dhaka Medical College and Hospital and seemed likely to survive, said Jasmin Nahar, a surgeon at the hospital.