Mustafa A.G. Abushagur is prime minister of Libya.

Libya lost one of its most ardent international supporters and a true friend last week with the death of U.S. Ambassador Chris Stevens. The terrorist attack on the American compound in Benghazi is still being investigated, but it is clear that the perpetrators sought to derail Libya’s democratically elected government and to injure its vital relationship with the United States.

What’s also clear from counter-demonstrations that have taken place across Libya is that the Libyan people stand with the United States in support of democracy and in opposition to such horrific acts of terror.

Ambassador Stevens was a dear friend of mine, and he played a key role in helping to liberate Libya from the oppressive regime of Moammar Gaddafi. After arriving in Benghazi on a freighter in the midst of war in April 2011, Stevens risked his life to coordinate invaluable U.S. support, when even the truest believers in our revolution harbored doubts as to whether it would be successful.

Libya’s new General National Congress had scheduled the election for prime minister for Sept. 12. Despite the tragic events of the previous day, this milestone in our democratic transition went forward as planned. I take solace in knowing that was what Stevens would have wanted.

I was honored to be elected prime minister by that Congress — the first time a prime minister has been elected in Libya’s history.

A day that began under the worst circumstances ended with hope and optimism. As we grieve the loss of our friend, we honor the legacy he left us.

Stevens remained a loyal friend to Libya because he knew that our revolution could succeed and that the Libyan people desired a stronger relationship with the United States. Libyans will always remember that, in our greatest hour of need, America came to our assistance, helping the freedom fighters push back Gaddafi’s forces.

Our appreciation for steadfast U.S. support is reflected in a Gallup finding last month that a majority of Libyans approve of America’s leadership. This is among the highest approval ratings Gallup has ever recorded on the question in the Middle East and North Africa.

Libya is a moderate, tolerant country that does not condone violence as a form of expression. While others protested and rallied over alleged insults, Libyans gathered in the public squares of our cities to mourn the loss of our American friends, to honor the American contribution to our freedom and to reject the violence a small group of criminals perpetrated against the U.S. Consulate.

Let me be clear: The Libyan people will never trade one form of authoritarianism or extremism for another. We didn’t free ourselves from a tyrant’s iron grip just to be shackled by ideological dogmatism or any other form of tyranny.

There is never a justification for terrorism. It runs counter to the foundations and values of a free Libya, of democracy and of Islam. The Libyan people are determined to bring to justice those who were involved in the attack against the U.S. Consulate in Benghazi last week.

These are difficult times in my country. Our revolution will be complete only when our state institutions are strong, when heavy arms are controlled only by the government and when our streets are safe to all Libyans and our revered guests. Our shared security is the bedrock of our freedom.

What I ask of America is do not lose faith in Libya. Stand with us as we build a democratic society, and help us transform our country into a beacon of hope for a region once plagued by despotism.

If we move forward as a nation with the same courage and optimism that sparked our revolution, the same optimism and courage that Chris Stevens embodied throughout his service in Libya, there are no obstacles we cannot overcome.

Inspired by the memory of our friend and our hopes for future generations, we remain committed to the cause of freedom, democracy and opportunity.