CAIRO — When the crowds massed against him at the start of the Arab Spring in January 2011, Hosni Mubarak vowed never to flee his country for an exile in disgrace. “Egypt and I shall not be parted until I am buried in her soil,” he declared.
That came to pass on Wednesday when Mr. Mubarak, 91, Egypt’s ruler of three decades, was buried with full military honors at a funeral in Cairo attended by family, former allies and the country’s latest military-backed strongman, President Abdel Fattah el-Sisi.
“Mubarak passes into God’s custody,” read the headline on the front page of the state-run Al Ahram newspaper.
At a short, tightly choreographed ceremony outside a military-run mosque, Mr. el-Sisi led a procession of mourners behind the coffin of Mr. Mubarak, who died in a hospital on Tuesday from kidney and heart complications.
It was a moment that Mr. el-Sisi, wary of any residual public sympathy for Mr. Mubarak, had been anticipating for years. The ceremony framed Mr. Mubarak as a war hero, for his role in Egypt’s 1973 conflict with Israel, and played down his record as its longest-serving president.
A 21-gun salute rang out as horses pulled a carriage bearing Mr. Mubarak’s flag-draped coffin. A soldier marched behind, carrying Mr. Mubarak’s military medals neatly arranged on a board.
Mr. el-Sisi, in sunglasses, walked alongside Mr. Mubarak’s sons, Alaa and Gamal, once reviled as symbols of the elite cronyism that shadowed Mr. Mubarak’s last years of rule. They now live quietly in Cairo’s suburbs.
Mr. el-Sisi shook hands with Mr. Mubarak’s widow, Suzanne, also a dominant force in Egyptian public life during her husband’s rule. Mrs. Mubarak was lauded for campaigns to promote population control and education, and criticized as the preening wife of a leader who presented himself as a kind of modern pharaoh.
The leaders of Al Azhar, Cairo’s great seat of Muslim scholarship, offered their condolences, as did Western and Arab diplomats. Notably for a figure of Mr. Mubarak’s former prominence, there was no sign of any foreign leaders among the mourners.
The military honors were contentious. Although Mr. Mubarak was acquitted of a raft of criminal charges after his ouster in 2011, one charge, for corruption, stuck. After that conviction in 2015, Egyptian media outlets reported that, as per custom, he would be denied a funeral with military honors.
But the custom was ignored, and as the funeral was broadcast on state television, it seemed that the government just wanted to talk about his military career, with only fleeting mentions of his time as president, and then only of his foreign policy.
There was one allusion to the 2011 uprising: The mosque where the funeral took place is named after retired Field Marshal Hussein Tantawi, who headed the military council that took power after Mr. Mubarak stepped down.
The highway leading to the giant mosque was lined for miles with security officers in suits or leather jackets, reminders of the powerful security apparatus known for its brutality and impunity under Mr. Mubarak. At least 800 people were killed in the early weeks of the 2011 uprising, before he was forced to resign. But the location mostly spoke to Mr. el-Sisi’s vision of Egypt. The highway leads to his new administrative capital, a pet project costing tens of billions of dollars that is under construction in the desert east of Cairo.
Along the way, giant billboards advertised flashy real estate ventures intended to appeal to middle- and upper-class Egyptians. One computer-generated image promised “The largest infinity pool in the world.”
A broad-shouldered man who survived several assassination attempts, Mr. Mubarak evoked an invincibility that was the stuff of myth among ordinary Egyptians. According to a popular joke, when God informed Mr. Mubarak it was time to bid farewell to Egyptians, he responded: “Where are they going?”
After Mr. Mubarak was toppled, many Egyptians were stunned by images that showed him glowering behind the bars of a courtroom cage, or wheeled into his trial on a gurney to face accusations of corruption and murder.
But in 2017, Mr. Mubarak was cleared of the most damaging charges, and the myth of his durability was revived. Just last fall, he gave interviews in which he boasted of his role in Egypt’s wars.
But on Jan. 21 he was hospitalized with an intestinal obstruction and underwent surgery. He died on Tuesday from heart and kidney complications, according to medical documents cited by The Associated Press.
The funeral on Wednesday, on the edge of the city, was closed to ordinary Egyptians, unable to pay their respects to the man who had dominated their lives for so long.
Mr. Mubarak’s coffin was moved to a cemetery near his home in the neighborhood of Heliopolis, where he was buried in a private service.
The aura of invincibility was not quite shattered — the autocrat had survived long enough to see those who revolted against him imprisoned, killed or forced to flee. But now, finally, he was lowered into the soil of Egypt.
Nada Rashwan contributed reporting.