ISLAMABAD, Pakistan — Pakistan’s devastating floods, a month on and still pushing relentlessly from north to south, are remaking not only the country’s geographic landscape, but its political landscape as well.

While the civilian government continues to bungle its own relief efforts, watching its credibility erode in the process, the country’s military is enjoying resurgent power and popularity as it appears to deftly flutter from region to region, leading the humanitarian mission.

Filling whatever holes that are still left — and there are many — religious groups, some with close connections to the Pakistani Taliban and other militant organizations, are making a concerted effort to endear themselves to local populations by providing help to those in need.

All of it adds up to a political picture in Pakistan that experts say could look vastly different than it did before the disaster struck.

“I foresee a radical change in the country’s social and political dynamics in the wake of these floods,” Abdul Khalique Ali, a Karachi-based political and security analyst, said. “The secular forces have failed to win the confidence of the people.”

A changed political dynamic here could have far-reaching implications. The United States has courted Pakistan over the last decade as a key ally in its fight against Islamic extremism, depending on a civilian-run government to keep in check rogue elements of the country’s military and spy agency, which the U.S. believes to be covertly propping up the Taliban in Afghanistan.

The floods that began in late July have so far left more than 1,500 people dead and millions more displaced. By some estimates, the floods have affected more than 20 million Pakistanis. As the disaster persists, new threats crop up, including waterborne disease and food shortages. And while the civilian government has been slow to respond, the Pakistan Army, the sixth largest in the world, has taken center stage.

A constant loop of TV footage — often set to the tune of the national anthem — showing army personnel rowing women and children to safety, tossing food from choppers to the thousands still trapped in floodwaters, treating patients at makeshift clinics and guarding weakened dams and embankments has helped to ease whatever bitter memories the public might have harbored against the military following the nine-year, rollercoaster reign of Gen. Pervez Musharraf, which ended in 2008.

“The army has stolen the show,” Salim Bukhari, a Lahore-based political analyst, said.

The army has been helped along, of course, by a lackluster performance from the administration of President Asif Ali Zardari.

Already unpopular, Zardari has been criticized without end for taking a European tour during the early days of the floods, which are now considered one of the worst natural disasters in recent memory, and the government has been playing catch up ever since.

The political turnaround has been so complete, in fact, that a fresh debate over which institution — the civilian government or the military — can best lead the country now dominates Pakistan’s media. The debate at times grows so loud here it eclipses stories about relief efforts.

“If the civilian government does not act swiftly to save its drifting credibility, the distressed people of Pakistan may once again chant the slogan, ‘Long live the Pakistan Army,’” Bukhari said.

Pakistan’s Army has held power for more than half of the country’s 63-year history, most recently under Musharraf. Despite efforts toward democratic reform, many Pakistanis view the current civilian government as corrupt and the military as better equipped, and better organized, to lead the country.

Adding to the government’s problems are persistent rumors, often carried as fact by Pakistan’s vibrant media, that several civilian ministers and ruling lawmakers deliberately breached dams to save huge tracts of their own agricultural land, diverting the floods into neighboring areas.

Whether true or not, the rumors are adding to a perception that the civilian government does not act in the public’s interest. Several minority political parties, including at least one coalition partner, have seized on the rumors to call for a return of military leadership.

“The government has miserably failed in its first test: rescue. Now the second test, rehabilitation, is at hand. And if it fails in this test too, there will be total chaos,” Bukhari said.

But few analysts expect the government to perform any better during the rehabilitation phase of the emergency. Transparency International ranks Pakistan as one of the most corrupt countries in the world and people here often call Zardari, who was elected in 2008, Mr. Ten Percent, a reference to the endemic corruption within his government and the widespread practice of officials taking kickbacks.

Reconstruction after a major natural disaster often requires the management of billions of dollars in international aid donations, a task few here believe the Pakistani government is equipped to handle without vast sums being lost to corruption.

Islamic fundamentalist groups, meanwhile, are finding the space to re-establish footholds in key regions throughout the country, military officials and experts said, including in the Swat Valley, one of the region’s hardest hit by the floods.

“The people are getting desperate with every passing day,” Ali said. “Government ministers and lawmakers are nowhere to be seen during these circumstances, while the army and the religious charities are very much visible.”

While few envision a military coup in the wake of the disaster, a remaking of the country’s leadership appears almost certain.

“This will all certainly matter in the next elections,” Ali said.