"History is sweeping" through the Middle East and North Africa, UK Prime Minister David Cameron has said.
In a speech to the Kuwaiti Parliament, he praised the "brave and peaceful" protests by people "hungry for political and economic freedom".
Too often politics in the Middle East was seen as a "false choice" between repression and extremism, he said.
Foreign Secretary William Hague has said the UN Security Council "must bring its influence to bear" in Libya.
In Kuwait, Mr Cameron again condemned the Libyan regime's violent crackdown against popular protests, describing it as "appalling".
"Violence is never an answer to people's legitimate aspirations," he said, adding that the whole world had been "shocked" by the actions of the Libyan leadership.
At least 62 people were killed in the Libyan capital, Tripoli, alone on Monday and Tuesday, according to Human Rights Watch. That is in addition to at least 233 people who have died in the violence of the past week.
Attending ceremonies marking the 20th anniversary of the liberation of Kuwait following Iraq's invasion - which sparked the first Gulf War - Mr Cameron said only freedom, justice and the rule of law would allow countries to meet the aspirations of their young populations.
Mr Cameron said Britain had been wrong to support some repressive regimes just to promote stability: "I say that is a false choice. As recent events have confirmed, denying people their basic rights does not preserve stability, rather the reverse."
And he said any suggestion that Arab or Muslim countries "can't do democracy" bordered on racism.
He argued that only political and economic reform could ensure long-term stability.
There were grounds for "cautious optimism" in the region because the majority of protesters seeking change had done so "peacefully and bravely", he said.
"This is a precious moment of opportunity for the region," Mr Cameron said. "We stand with the people and governments who are on the side of justice, the rule of law and freedom."
Answering questions after the speech, he refused to name any specific regimes the UK had been wrong to support but said he rejected the "naive neo-con approach that you could somehow drop democracy out of an aeroplane" and a "more subtle" approach was needed.
A Kuwaiti journalist asked whether the West wanted to see more popular revolutions in countries like Saudia Arabia, Bahrain and Kuwait.
Mr Cameron replied: "There is no secret agenda here, and it is not a Western agenda. We have condemned violence and repression against people wherever it has happened... I would not accept the contention that somehow we have been inconsistent between different countries or different situations. We respect the differences in different countries."
During his visit, which was originally planned as a trade-centred tour of the Middle East, Mr Cameron also defended trade between British arms companies and some regimes in the Arab world.
Eight of the 20 businesses accompanying Mr Cameron are from defence and aerospace firms. The trip comes just days after the Foreign Office revoked a series of export licences to Bahrain and Libya covering tear gas and gun components following the violence in both countries.
But defence-related businesses on the trip contacted by the BBC said they were not affected by the government's decision to revoke the licenses and had no, or minimal, business with Libya.
Mr Cameron said Britain had "a range of strong defence relationships" with countries in the region and British lives had been lost defending Kuwait "so the idea that Britain should not have defence relationships with some of these countries I don't understand".
"We have some of the toughest rules on export licences and exports of arms anywhere in the world. Everything has to meet those rules."
And Defence Secretary Liam Fox said the UK had among the strictest export controls in the world and the UK had a "perfectly legitimate interest" in supplying defence equipment to countries without a home-grown arms industry.
But shadow foreign secretary Douglas Alexander told the BBC Mr Cameron was "trying to straddle two horses at once" and he should instead focus on the diplomatic and political challenges.
"I'm not sure my priority would have been a trade mission in this week, of all weeks," he said.
"I support the promotion of British exports and British goods; that is important to our economic recovery. But I think the last couple of weeks has been a very salutary reminder to David Cameron and to others that foreign policy embraces more than simply trade policy...
"This was essentially a trade-focused visit onto which has now been tacked a broader agenda for the Middle East. I think what we need for the Middle East is a more strategic approach that recognises many of those old orthodoxies have been challenged and demands a new and more strategic response, not just from Britain but from the European Union and from others."
Mr Cameron arrived in Kuwait City from Egypt, where he had met caretaker Prime Minister Ahmed Shafiq and the de facto leader, Field Marshal Hussein Tantawi, and walked through Tahrir Square, the centre of the demonstrations that led to the fall of President Mubarak.