BAGHDAD — A pair of suicide bombers blew themselves up in central Baghdad early Monday, killing 27 people and injuring scores more in the first major attack in the capital since Iraq declared victory over the Islamic State in December.

The attack breached one of Baghdad's most secure areas, underscoring the urgency of what Iraqi and American officials have said is a crucial transition from combat to traditional counterterrorism.

There was no immediate claim of responsibility for the bombings, which came as electoral coalitions began taking shape this week ahead of expected national elections in May. Previous elections have been marred by spasms of terrorism, and Monday's violence raised concerns that despite the military victory over the Islamic State, this campaign season would be no different.

Iraq's Interior Ministry said that the first bomber targeted Baghdad's Tayaran Square about 7 a.m. and that the second explosion came less than 10 minutes later. The square is a major way station for commuters and a place where day laborers gather in the hopes of picking up work.

A second blast is typically used by insurgent groups to catch police, emergency personnel and even bystanders gathering at the scene of an initial attack.

The square is a bustling shopping destination for people looking for discounted clothing and electronics. Had the bombers struck hours later, the death and injury toll could have been devastating.

Witnesses said the square was beginning to fill up with its usual array of sidewalk vendors, shoppers and workers when the first blast occurred. As people rushed to help the victims amid the wreckage and mangled bodies, the second bomber blew himself up.

Ali Mohammed Jaafar, a 42-year-old attorney, bitterly noted that the attackers targeted an area frequented by "poor people trying to make a living."

"Human flesh was everywhere, and we moved the victims using wood carts before the ambulances arrived," he said.

He observed that many of the dead and wounded were young men.

"All of them are young poor people that left families behind with unknown future," Jaafar said.

A Health Ministry spokesman said 102 people were injured in addition to the 27 killed. The death toll was expected to rise.

The blasts raised anxieties throughout the capital, where people in large numbers had just broken years of caution to publicly celebrate two recent occasions until the late hours.

The evening Iraqi Prime Minister Haider al-Abadi declared the Islamic State defeated in early December, thousands of Iraqis poured into the streets to wave flags and celebrate. On New Year's Eve, the streets were similarly bustling with revelers ushering in what they hoped would be a period of calm after the nearly four-year war to uproot the Islamic State.

Though major combat operations backed by the United States have ended, pockets of militants have been able to stage attacks in areas they once administered. Iraqi and American officials said they expect the group to return to traditional terrorism tactics after losing the territory it had controlled, and authorities are responding by turning their attention to gathering intelligence to thwart attacks before they happen.

U.S. troops stationed in Iraq, who had assisted combat operations, are focusing on training Iraq's police and military to break up sleeper cells, American military officials said late last year.

Iraqi security forces say they have already succeeded in identifying and dismantling Islamic State cells all over the country. Brig. Gen. Yahya Rasoul, the top spokesman for Iraq's joint operations command, said Monday's attack, though deadly, was carried out by suicide bombers on foot rather than by car bombs, which have proved far more devastating in previous years.

He said the method of the bombing was an indication of the militants' degraded capacity and Iraq's tightened security protocols.

Rasoul said security forces are girding for a wave of attempts to disrupt the upcoming elections.

"The enemy still has the ability to attack cities by sleeper cells, but it's not like before. The victory [over the Islamic State] has limited their ability," he said. "Now with the elections, I expect there will be more attacks to show that they still exist, but we will make every effort to stop them."