SHADAD KOT, Pakistan — Pakistan’s president defended the government’s much-criticized response to the country’s record-breaking flood crisis as emergency workers worked frantically Monday to shore up a system of levees protecting two southern cities.

The floods, which began nearly a month ago with hammering rains in the country’s northwest, have affected more than 17 million people, a U.N. official said, warning the crisis was outstripping relief efforts. About 1,500 people have died in the floods, most in first few days, though the crisis continues to grow.

President Asif Ali Zardari said anger at the government in the coming months is inevitable given the scale of the disaster, comparing it to the anti-government sentiment generated by the aftermath of Hurricane Katrina in the United States.

“There will be discontent, there is no way any nation, even a superpower can bring the same level of satisfaction that will be close to the expectations of the people,” Zardari said in an interview with a small group of foreign reporters in the capital, Islamabad.

Still, he defended his handling of the crisis and said the government “had functioned to its fullest capacity.”

The widespread misery of the floods has triggered speculation of social unrest, food riots or even a challenge to the government’s rule before its term ends in 2013.

The floods have so far destroyed or damaged 1.2 million homes and affected 17.2 million people, U.N. spokesman Maurizio Giuliano said.

“The floods are outrunning our relief efforts. We move faster and faster, but the finish line keeps moving further ahead,” Giuliano said.

In Shadad Kot, in the southern province of Sindh, authorities are increasingly worried that even the 10 miles of new levees soldiers have built to protect the city, and Qambar city further to the south, may not hold back the massive floods.

Workers were piling stones and sandbags to plug leaks in the levees, trying to stay ahead of any damage to the defenses.

“It is the last-ditch effort to save the city,” said Brig Khawar Baig. “We are trying to block the water here. If it crosses over, we fear it will go further south and inundate more towns.”

Ninety percent of Shadad Kot’s 350,000 residents have already fled the city. Many have also left Qambar and other nearby towns.

On the eastern side of the city, levees were under pressure from 9-foot-high floodwaters, said Yaseen Shar, the top administrative official.

Zardari has been criticized for his initial response, especially since he left for Europe just as the crisis was unfolding.