DAKAR, Senegal — Abba Kyari, the chief of staff of Nigeria’s president and one of the most powerful men in the country, died April 17 in a cardiology hospital in Lagos. He was said to be 67.

The cause was complications of the new coronavirus, the Lagos state government said. Senior government officials attended his burial the next day in Abuja, the capital, and were criticized by medical officials and health workers for doing so and for not practicing social distancing.

Kyari amassed more power than any previous chief of staff in Nigeria. Anyone who wanted to see President Muhammadu Buhari, including ministers and Nigeria’s influential state governors, had to go through him.

“He acted forcefully as a crucial gatekeeper to the presidency,” Buhari said, who called him a “loyal friend” in a tribute posted on Twitter.

Kyari also helped negotiate government deals and, according to a letter leaked to a Nigerian newspaper, gave orders to security chiefs without Buhari’s knowledge. About a week before he tested positive for the virus, he was in Germany meeting with energy officials at Siemens on a deal to restore Nigeria’s electricity grid.

Kyari was able to take on so much partly because Buhari, who was reelected last year, was frequently absent because of an unknown illness. The two had met when Kyari was in his 20s.

A banker, lawyer and journalist before he went into politics, Kyari was originally from Borno state in Nigeria’s northeast. He studied sociology and law in the United Kingdom, where he attended Warwick and Cambridge universities. Geoffrey Onyeama, the country’s foreign minister, reminisced about attending discothèques and parties together at Warwick early in their long friendship.

He was known as an erudite man with a ready wit and an open door. But he was also private and secretive. He faced a variety of allegations, including that he had taken a large bribe over a fine imposed on a telecommunications company. He never responded in public.

Even his age — 67, according to the president — was the subject of much speculation.

He is survived by his wife, Hajiya Kulu Kyari, and their four children.

Being so influential brought power struggles.

When the first lady, Aisha Buhari, spoke cryptically of a “few people” who were controlling her husband’s government, most Nigerians thought she meant Kyari and Mamman Daura, the president’s octogenarian nephew.

On Saturday in a Twitter message offering condolences to Kyari’s family, Aisha Buhari said she was praying that Allah would “forgive his shortcomings.”

This article originally appeared in The New York Times .