The office is scarred and shabby, with files jumbled on desks and phone numbers scribbled on walls. There is an air of glee and gravitas, mayhem and mission, like the campaign office of a young firebrand running his first political race.

But the firebrand is in his 80s now, and the office is the headquarters for a revolutionary charitable movement he has built over the past four decades. His mission is to serve poor Pakistanis who are shunned by society, while trying to shame the elites that ignore them and to change the traditions that condemn them to suffer.

His name is Abdul Sattar Edhi. He is a legend in Pakistan, where he has been hailed as a Mahatma Gandhi and Father Teresa — and denounced as an infidel, communist and madman. In a patronage-based nation where wealth and bluster often pass for leadership and cruelty is more common than mercy, he may be Pakistan’s only true living hero.

I first found my way to Edhi’s office in the summer of 2010. I knew little of him then, except that he had founded a free ambulance service for the public. At the scene of every train crash or terrorist bombing, Edhi Foundation ambulances always rushed about. I knew many Pakistanis admired him, and I had seen photos of an old man with the flowing white beard of a wise elder or a Muslim cleric.

I was not expecting the slyly subversive and cranky octogenarian who sat at his desk under a portrait of Pakistan’s founder, Muhammad Ali Jinnah. He didn’t say much at first, but he handed me some photographs of a tiny girl with gashes in her face. She had been found in a garbage pit, partly eaten by dogs, and was rescued by his volunteers. Later she was sent abroad for surgery and adopted by a family in Canada.

“Some people strangle illegitimate children. Others just dump them to die. We believe there is no such thing as an illegitimate person,” Edhi said. Indeed, he had spent 40 years helping social outcasts, from unwanted infants to the unclaimed dead. He had opened programs for abandoned girls, AIDS patients and senile shut-ins. Far more than an ambulance service, it was a philosophy.

I asked whether he was a religious man, and he shook his head. “My religion is humanity. It is the only religion that matters,” he said. This was a startling statement to hear in an Islamic republic. Later, I learned that some Muslim clerics had banned mosques from helping Edhi, but that admirers greeted him as “maulana sahib,” a term of religious respect.

There were other contradictions: Edhi was the product of a prominent business clan, but he had been drawn early to a humbler calling. After serving briefly in Parliament, he grew disillusioned with politics and rejected organized charity as placating rather than empowering the poor. In the 1960s, he turned full-time to his fledgling mission in the slums.

“I decided not to knock on the door of the industrialists and the landlords, because they are the root cause of all our social problems,” he told me. “The rich have deprived the people of their rights, and the state does not take responsibility for their welfare. It is my dream to build a welfare state in Pakistan, but I have not seen it come in my lifetime.”

The leftist tinge of his speech suggested that Edhi was more complex than a saintly do-gooder. He was a self-appointed conscience of the nation, seeking to shock the comfortable and galvanize the afflicted. And he got away with it, year after year, because he lived what he preached.

In his 1995 autobiography, Edhi wrote about the ordeals he embraced as a young man to challenge his own biases and set an example. “I brought back bloated, drowned bodies from the sea,” he recounted. “I bathed and cared for each and every victim of circumstance.” But even sympathetic helpers cringed from the stench and the filth, and he realized that the world of poverty and disease was frightening to many people. “Nobody wanted to stroll through it, let alone live in it,” he wrote. “For me, there was no other.”

In my own travels through Pakistan, I had peered into the lives of rural peonage and urban squalor, and cringed a little, too. I had seen charitable causes tarred by religious propaganda and corruption. I had met idealistic reformers who denounced one another as frauds. Edhi seemed to be an exception, but he had little patience for foreign visitors like me.

It was his wife, Bilquis, who showed me the work of the Edhi Foundation. I knew that people in Pakistan suffered from social and tribal traditions, but observing the Edhis in action made me understand how subversive it was to defend the victims of these mores — and what a daunting mission it was to try to change them.

“People say we are crazy, but our main goal is to respect everyone and to create respect for everyone,” Bilquis told me as we arrived at Sarabkot, a boarding school for 250 girls with a homey atmosphere but a rigorous schedule of classes and prayer. The girls wore uniforms and slept in 18-bed dorms.

Two sixth-graders agreed to talk to me after class. Both had been left there by their families as young girls. “I miss them, but I think they forgot about me,” ventured one, her eyes filling with tears. “Maybe if I study hard and get a good position, one day they will take me back.”

Bilquis said many girls end up at Sarabkot after their stepfathers decline to support them or try to molest them. Sometimes, after years of no contact, a mother suddenly reappears to claim her daughter. Bilquis cannot legally refuse, but if the family “wants to marry her off to an old man for a lot of money,” she said, “I try to find a better alternative.”

Sarabkot is an old seaside mansion, its high-ceilinged rooms filled with bunk beds and donated clothing. A parlor has been decorated with plaques and awards, but it is the basement that showcases the Edhis’ mission to bring dignity to the forgotten. It has been turned into a frilly salon with satin sofas and a red-carpeted stage, fit for a fairy-tale princess.

“We give our girls birthday and engagement parties here. It makes them feel special. And we have had 210 weddings,” Bilquis said. “I work hard to find the girls good husbands. They have to finish high school first, and they have to meet the boy and be happy with the match.”

The foundation’s work with girls has been controversial. Neighbors sued in an attempt to shut down Sarabkot, saying that it was used as a brothel. Edhi has spoken out against tribal councils that barter brides to pay for crimes or settle disputes, and Islamic laws under which rape victims can be charged with adultery.

Yet he has always preached from an unassailable perch on the lowest rung of the ladder. Even now, as a traveled and honored celebrity, he still practices poverty. In his autobiography, he recounts how he horrified his hosts on a first-class foreign tour by washing his own socks and underwear and hanging them out to dry.

He is not an easy man to be around, demanding that his acolytes give up even small luxuries. Yet his army of volunteers and ambulance drivers, some rescued from lost lives, revere him, and Bilquis, after four decades at his side, remains his tireless partner and ally.

Edhi, ever the crusader, still dreams of building a modern welfare state that will be at least another generation in the making, but his wife’s greatest joy is in saving one child at a time, and in pampering brides whom no one in Pakistan would once have thought fit to marry.

Pamela Constable has reported frequently from Pakistan for The Post since 1998. This article is adapted from her new book, “Playing With Fire: Pakistan at War With Itself.”

Read more from Outlook, friend us on Facebook, and follow us on Twitter.

The Post’s Pam Constable profiles Abdul Sattar Edhi,

a rebel humanitarian