KARACHI, Pakistan (Reuters) - Pakistani philanthropist Abdul Sattar Edhi, revered as a "living saint" in the South Asian nation, was buried on the outskirts of Karachi on Saturday after a state funeral attended by thousands of people.

Edhi, 88, died late on Friday after a long kidney illness, triggering an outpouring of grief in the impoverished nation of 190 million for a man who transcended social, ethnic and religious divisions.

At one moment during the country's first state funeral since the 1980s, a crowd broke through military lines at Karachi's National Stadium to help carry Edhi's coffin, which was draped with Pakistan's green and white flag and covered with rose petals.

Over nearly 60 years Edhi's charitable arm, the Edhi Foundation, established clinics and orphanages across Pakistan and ran a vast fleet of ambulances, offering help to poor communities failed by inadequate public health and welfare services.

Prime Minister Nawaz Sharif said Pakistan had lost "a great servant of humanity", and announced Saturday as a national day of mourning.

Many others took to social media to grieve over the loss of a man they called a "living saint" and "Pakistan's Mother Teresa".

"Edhi worked for the downtrodden all his life. Attending his funeral is the least we could do to pay our tributes," shopkeeper Siraj Ahmed, 34, said outside the stadium where the army fired a 19-gun salute to mark Edhi's death.

The foreign minister of India, Pakistan's historic foe, said Edhi "was a noble soul who dedicated his life in service of mankind", while Pakistani teenage Nobel laureate Malala Yousafzai told the BBC she had nominated him for the same Peace prize.

BURIED IN THE GRAVE HE DUG

Born in Gujarat in British India, Edhi and his Muslim family moved to Pakistan in 1947 during the violent partition of the subcontinent.

He built up his charity solely through donations, focusing on addicts, battered women, orphans and the disabled.

Renowned for an ascetic lifestyle and recognized by his long white beard and traditional black cap, Edhi was a hero to the poor but infuriated some religious leaders for his refusal to give preferential treatment to Muslims above minorities.

He also berated radical Islamist groups for attacking civilians, criticized the government for incompetence and corruption, and denounced tax-dodging by the rich.

The Edhi foundation was at the forefront of the response last year when a devastating heatwave struck Karachi, a city of about 20 million people.

Pakistan army chief Raheel Sharif and prominent politicians attended final prayers at the stadium in the first state funeral since the death of military dictator General Zia ul-Haq in 1988.

But other Pakistanis lamented the way the government had conducted Edhi's funeral.

"Saddest of all is the barrier between Edhi and ordinary people. The state continues to fail to understand Edhi and what his work was about," said one Twitter user identified as Basma.

Edhi was laid to rest in the clothes he died in, and buried in a grave he himself dug several years earlier at the Edhi cemetery near Karachi.

(Additional reporting by Mehreen Zahra-Malik; Writing by Drazen Jorgic; editing by John Stonestreet)