The belated finale for Muammar Gaddafi began on a marble slab in a car park and ended with a lonely burial in the desert far from the reach of family or foe.

After his body spent five days on gruesome display, Libya's new rulers finally decided late on Monday night to put Gaddafi to rest, capping a week of uncertainty about what to do with the slain despot's remains and closing an era of fear and infamy.

"We gave him all the Islamic rituals that we would give any Muslim," said the deputy chief of Libya's new governing council in Misrata, Sadiq Badi. "It was more than he would have given us, but we gave him a dignified end."

He was prepared for burial alongside two other corpses – his son Mutassim and his former military chief, Abu Bakr Younes, who had been holed up with him during the fall of Sirte.

Just before midnight, three Islamic holy men, all of whom have been imprisoned by rebels, along with three family members of the dead men, were taken from their cells in Misrata to a building on the outskirts of town.

The six men were told to wash the three bodies. Younes's sons, Osma and Younes, were allowed to clean their father, while the grandson of Gaddafi's sister, Sharif al-Gaddafi, had the task of washing his great-uncle. They were the only family members allowed near the bodies.

Libyan officials rejected repeated requests from the Gaddafi tribe in Sirte to hand over their patron and leader. Overtures from his wife, Safia, and daughter Aisha were also turned down.

Alongside the men were three sheikhs who the regime had used to help secure its 42-year grip. Khaled Tantoush, Medina Shwarfa and Samira Jarousi were loyal to Gaddafi until the end, their captors say.

They crouched at a cream-coloured marble slab, which was slick with water from a nearby garden hose. Nearby, three tables stood illuminated by a giant lamp, a generator purring next to them and uniformed rebels watching from the shadows.

The slab was outside a nondescript government building that like many others in Misrata had been ravaged during the civil war. It was purpose-built for washing corpses, an essential prerequisite for Islamic burials, almost all of which are conducted within 24 hours of death.

The extended time above ground had clearly taken a toll on Gaddafi's remains and Tantoush said preparing the dictator for burial was an unpleasant experience. For most of the previous five days, the decaying bodies had been displayed on blood-stained mattresses in a meat-packing crate, with thousands of people clamouring for trophy photographs.

The spectacle had stirred disquiet in Misrata and turned stomachs abroad. Libyan officials defended the display as a need for people of this traumatised country to find closure and to see for themselves that their 42-year ordeal was over.

"I didn't feel anything when I was washing him," said Tantoush. "I was just doing my duty as a Muslim. He was a person and he should be properly buried."

"Liar," muttered one of his jailers, Haithem Danduna, at Tantoush. "He is a chameleon," he added, pointing at Tantoush. "He was green until a week ago," in reference to the colour of the regime.

Appearing flustered, the sheikh continued: "It was a good thing what they did last night, allowing us to bury him. It was a good start of a new beginning. After we finished washing him we moved to the tables and we wrapped them in white, then prayed for them. The whole process took about an hour. The guards helped us move the bodies."

The whereabouts of Gaddafi's grave is a closely guarded secret in Misrata. Authorities here and elsewhere in Libya are anxious to avoid his grave site becoming a shrine for his supporters, or a target for his enemies.

Of his inner circle, only Gaddafi's long-term driver, Huneish Nasr, and Sharif were present at the burial alongside rebel guards. "We are not going to let him be remembered as a martyr," said Danduna. "He got a proper burial and now let the desert consume him."

Across town, at a cemetery for nameless victims of the war, gravedigger Salam Zwaid pointed a gnarled hand at the grey slabs behind him. "This is the best Gaddafi could have hoped for," he said, walking through the shallow graves, all of which were sealed by cheap concrete.

"He saw himself as the king of kings, someone who was better than all of this," he said. "But he was no god. He was a person and a bad person at that. No one should learn where he was buried."

Back at the prison, Tantoush claimed the burial could be cathartic for Libya, where Gaddafi's brutal end is still sinking in. "In the beginning I thought he was righteous and on the right path," he said in remarks his jailers insisted were self-serving. "And after 17 February every bit of news we got was wrong. We didn't know this was a real revolution.

"I was in Sirte and after a while we knew he was there. But I changed my support for him a month ago when they wouldn't let the Red Cross enter to treat the wounded. After that it all became clear.

"His death should wake people up. It is time to move on now. I hope people never find his grave. If they wanted to tell me where it was, I would not want to know. All Libyans should think the same."

Pictures of Gaddafi's corpse continue to be published in Libyan newspapers and shown on TV. Freshly painted graffiti on the streets of Tripoli – in Arabic and English – read: "Dictator Gaddafi sent a message to the Libyan people from hell, saying 'I am staying here.'"

Images were also circulating on the internet apparently showing Gaddafi being sodomised with a stick or metal rod. The footage was shot on a video on a mobile phone and includes sounds of gunfire and shouts of "Allahu akbar."