Tobias Ellwood is a Foreign Office Minister and MP for Bournemouth East.

Read some headlines and you might assume that our involvement in Libya’s Arab Spring caused more problems than it solved. Let’s set the record straight and place events in context.

As a country Libya is young – its name was first given in 1934 to the three provinces containing over a hundred tribes, mostly located on the coast line, which have traded and sparred with each other for centuries. In 1969, Captain Gaddafi led a successful military coup against the ruling monarchy. He quickly promoted himself to Colonel, emulating his childhood hero, Colonel Nasser (who had similarly come to power in Egypt) and so began 42 years of misrule, denying Libyan society the ability to evolve and develop.

By early 2011, the Arab Spring tide for change reached Liby’s shores, resulting in a bloody revolution. To avoid a blood bath in Benghazi, the UN approved intervention in the form of a no fly zone. In October of that year Gaddafi was killed. The new Libyan leadership, in the form of the National Transition Council, severely limited international stabilisation and governance assistance, preferring instead to make their own decisions.

However, meeting the demands of dozens of power bases, now elbowing for authority and territory after four decades without a voice, has been an immense challenge. It has left us where we are today, with effectively two separate Parliaments – the elected House of Representatives and the internationally unrecognised General National Congress (GNC), vying for power.

There is no doubt that the nation has become war-weary, conscious that a failure to resolve matters is creating greater problems. The absence of a working government has given space for extremists and ISIL to embed themselves in some communities, and for criminal gangs to exploit the porous borders and organise significant movements of economic migrants from the Sahel to the Mediterranean Sea.

Britain has been working closely with Bernardino Leon, the UN envoy, to bring the conflicting sides together. Last month, a critical first step was taken to restore stability with an agreement to establish a Government of National Accord. This maps out a route towards a permanent ceasefire and future elections. The majority of Libyans have welcomed the agreement. We continue to urge the GNC to rejoin the dialogue process and sign the agreement. Recent local cease fire agreements in the north-west, negotiated between Libyans themselves, are welcome signs that peace in Libya is achievable.

It will of course take time to rebuild the country and its institutions, and to establish security and the rule of law. Libya has vast natural resources, and peace and stability will enable the country to flourish, offering prosperity to the Libyan people and having a positive impact on the wider region. What is needed is that the will of the people confirm an inclusive political settlement paving the way for a post-revolution transition.

Time is of the essence. We have seen barbaric acts of terror, including the murders of Egyptian Coptic Christians and Ethiopian Christians as ISIS and its affiliates exploit the absence of effective governance. The terrorist attack by a Libyan-trained gunman in Tunisia in June underlines why denying extremism the space to incubate is so important for the region as well.

This year, Britain is providing an additional £10m to support the political process and we are playing an active role in challenging uncontrolled migration and its root causes. There are no quick fixes or easy answers. However, a peaceful, prosperous Libya is in all our interests. That is why the UK remains committed to supporting Libya and we stand ready to help rebuild the country once a Government of National Accord is formed.

Four years ago the Libyan people fought bravely in search of a better future for themselves and their families. They are not yet there. We will work with them to build a prosperous and well-governed country.