If Muammar Gaddafi had been captured alive, the problem of which court to try him in may have been insurmountable. Photograph: Vittorio Zunino Celotto/Getty Images

The death of Muammar Gaddafi avoids a potentially fraught legal process that could have pitted Libya's National Transitional Council (NTC) against the demands of international justice.

Libya's justice minister has repeatedly insisted Gaddafi – were he to be captured alive – would be tried in Libya under local law. The international criminal court in the Hague, however, issued a warrant against Gaddafi this year, charging him with using brutal force while suppressing demonstrations in February. It also issued a warrant for his oldest son and his spy chief.

It may have been possible to reconcile both claims. International lawyers suggested a compromise that could have seen a trial in Tripoli paid for by the UN and conducted under the auspices of national and international law. The process, however, might have dragged on for years. Libya's legal system scarcely exists and needs to be rebuilt from scratch.

In the meantime, Gaddafi would have been able to undermine democratic elections and rally disgruntled loyalist forces. At worst he could have led a fresh insurgency against the new government, from the Sahara or the south of the country, wrecking havoc on the NTC's credibility and destabilising Libya's neighbours.

Gaddafi's death means the debate over where to try him is irrelevant. It is a boost to Libya's acting government, which is already showing signs of weakness, internal strain and regional feuding. It removes a massive obstacle to the tricky, tentative process of political transition and nation-building after decades of autocracy.

There was disappointment on Thursday among some human rights activists that Gaddafi could no longer be made to answer for the numerous crimes committed during his 42 years in power. Richard Dickler, director of Human Rights Watch's international justice programme, said Gaddafi's death had deprived the Libyan people of the chance to see him held to account "in a fair trial at the ICC".

There is little doubt, though, that most Libyans regard his death as a cathartic moment. Photos of his bloodied corpse being dragged through Sirte triggered ecstatic celebrations across the country. There was universal recognition that four decades of dictatorship, ended by popular revolution, and nine months of civil unrest and insurgency were over.

It also means the end of Nato's UN-mandated military intervention in Libya.

"The NTC talked about putting Gaddafi on trial. But if he had been taken alive this would have hung over the processes of reconciliation and transition," David Hartwell, a senior Middle Eastern analyst with IHS Global Insight, said. He added: "Gaddafi could potentially have acted as a lightning rod for resistance to the new government."

Hartwell said that privately the NTC must be enormously relieved that Gaddafi had been killed. Viewed from a "realpolitik" perspective, this was the best possible outcome for the country, its present rulers and those optimistic enough to believe that Libya can eventually be transformed into a vibrant democracy, he added.

"The issue [if Gaddafi were still alive] could have created problems for the new government. Questions like 'Where is he? Is he still alive? Should he be put on trial' have all been eradicated. The process of reconciliation can begin," Hartwell said. Gaddafi's death also ends months of speculation as to his whereabouts – it appears he has been hiding for months in Sirte.

Gaddafi's death will have prompted huge relief in several western capitals. In the dock, there was every prospect that the former dictator, with nothing to lose, would have spilled embarrassing secrets about Libya's relations with leading European powers, international oil firms and former statesmen such as Tony Blair. Many oil corporations struck lucrative deals with his regime. They include BP, Italy's ENI and France's Total. They too must be breathing a sigh of relief.

"It is hugely symbolically important," Alan Fraser, Middle East analyst for risk consultancy AKE, told Reuters. "It helps the NTC move on … [it] means they will also avoid a long drawn out trial that could have been very divisive and revealed awkward secrets."

The bloody denouement to the hunt for Gaddafi also reflects the will of most ordinary Libyans. During the fall of Tripoli, numerous rebel volunteers – students, dentists, engineers and the unemployed – said they would only put down their weapons and return to civilian life once Gaddafi had been killed.

A minority politely insisted that Gaddafi should be tried. But the question: "What should happen to Gaddafi?" usually triggered laughter, followed by a straightforward admission: if we find him we will kill him. Even educated Libyans shared this sentiment. Any trial would most likely have ended with a death sentence anyway, they pointed out.

"Libya will be so much better without Gaddafi. If we get him, there is a court in Tripoli. But my view as a lawyer is that he should die," Naser al-Shahawi said in August, after the fall of Tripoli.

Other rights groups said that Gaddafi's death should not prevent a proper and transparent investigation into the crimes committed under his rule. Hassiba Hadj Sahraoui, Amnesty International's deputy director for north Africa and the Middle East, said there should be a "full accounting for the past", and that human rights should be embedded in Libya's new institutions.

"Colonel al-Gaddafi's death must not stop his victims in Libya from seeing justice being done. The many Libyan officials suspected of serious human rights violations committed during and before this year's uprising, including the infamous Abu Salim prison massacre in 1996, must answer for their crimes," he said. He added: "The new authorities must make a complete break from the culture of abuse that Colonel al-Gaddafi's regime perpetuated and initiate the human rights reforms that are urgently needed in the country."

Amnesty also called on the NTC to give a full explanation of how Gaddafi died to the Libyan people. So far, this hasn't happened.