I am honoured to be in the timeless city of Cairo, and to be hosted by two remarkable institutions. For over a thousand years, al-Azhar has stood as a beacon of Islamic learning, and for over a century, Cairo University has been a source of Egypt's advancement. Together, you represent the harmony between tradition and progress. I am grateful for your hospitality, and the hospitality of the people of Egypt. I am also proud to carry with me the goodwill of the American people, and a greeting of peace from Muslim communities in my country: assalaamu alaykum.

We meet at a time of tension between the United States and Muslims around the world – tension rooted in historical forces that go beyond any current policy debate. The relationship between Islam and the west includes centuries of co-existence and co-operation, but also conflict and religious wars. More recently, tension has been fed by colonialism that denied rights and opportunities to many Muslims, and a cold war in which Muslim-majority countries were too often treated as proxies without regard to their own aspirations. Moreover, the sweeping change brought by modernity and globalisation led many Muslims to view the west as hostile to the traditions of Islam.

Violent extremists have exploited these tensions in a small but potent minority of Muslims. The attacks of September 11 2001 and the continued efforts of these extremists to engage in violence against civilians has led some in my country to view Islam as inevitably hostile not only to America and western countries, but also to human rights. This has bred more fear and mistrust.

So long as our relationship is defined by our differences, we will empower those who sow hatred rather than peace, and who promote conflict rather than the co-operation that can help all of our people achieve justice and prosperity. This cycle of suspicion and discord must end.

I have come here to seek a new beginning between the United States and Muslims around the world; one based upon mutual interest and mutual respect; and one based upon the truth that America and Islam are not exclusive, and need not be in competition. Instead, they overlap, and share common principles – principles of justice and progress; tolerance and the dignity of all human beings.

I do so recognising that change cannot happen overnight. No single speech can eradicate years of mistrust, nor can I answer in the time that I have all the complex questions that brought us to this point. But I am convinced that in order to move forward, we must say openly the things we hold in our hearts, and that too often are said only behind closed doors. There must be a sustained effort to listen to each other; to learn from each other; to respect one another; and to seek common ground. As the Holy Koran tells us: "Be conscious of God and speak always the truth." That is what I will try to do – to speak the truth as best I can, humbled by the task before us, and firm in my belief that the interests we share as human beings are far more powerful than the forces that drive us apart.

Part of this conviction is rooted in my own experience. I am a Christian, but my father came from a Kenyan family that includes generations of Muslims. As a boy, I spent several years in Indonesia and heard the call of the azaan [the Muslim call to prayer] at the break of dawn and the fall of dusk. As a young man, I worked in Chicago communities where many found dignity and peace in their Muslim faith.

As a student of history, I also know civilization's debt to Islam. It was Islam – at places like al-Azhar University – that carried the light of learning through so many centuries, paving the way for Europe's Renaissance and Enlightenment. It was innovation in Muslim communities that developed the order of algebra; our magnetic compass and tools of navigation; our mastery of pens and printing; our understanding of how disease spreads and how it can be healed. Islamic culture has given us majestic arches and soaring spires; timeless poetry and cherished music; elegant calligraphy and places of peaceful contemplation. And throughout history, Islam has demonstrated through words and deeds the possibilities of religious tolerance and racial equality.

I know, too, that Islam has always been a part of America's story. The first nation to recognise my country was Morocco. In signing the Treaty of Tripoli in 1796, our second President John Adams wrote: "The United States has in itself no character of enmity against the laws, religion or tranquillity of Muslims." And since our founding, American Muslims have enriched the United States. They have fought in our wars, served in government, stood for civil rights, started businesses, taught at our universities, excelled in our sports arenas, won Nobel prizes, built our tallest building, and lit the Olympic torch. And when the first Muslim-American was recently elected to Congress, he took the oath to defend our constitution using the same Holy Koran that one of our founding fathers – Thomas Jefferson – kept in his personal library.

So I have known Islam on three continents before coming to the region where it was first revealed. That experience guides my conviction that partnership between America and Islam must be based on what Islam is, not what it isn't. And I consider it part of my responsibility as president of the United States to fight against negative stereotypes of Islam wherever they appear.

But that same principle must apply to Muslim perceptions of America. Just as Muslims do not fit a crude stereotype, America is not the crude stereotype of a self-interested empire. The United States has been one of the greatest sources of progress that the world has ever known. We were born out of revolution against an empire. We were founded upon the ideal that all are created equal, and we have shed blood and struggled for centuries to give meaning to those words – within our borders, and around the world. We are shaped by every culture, drawn from every end of the Earth, and dedicated to a simple concept: E pluribus unum – "Out of many, one."

Much has been made of the fact that an African-American with the name Barack Hussein Obama could be elected president. But my personal story is not so unique. The dream of opportunity for all people has not come true for everyone in America, but its promise exists for all who come to our shores – that includes nearly 7 million American Muslims in our country today who enjoy incomes and education that are higher than average.

Moreover, freedom in America is indivisible from the freedom to practise one's religion. That is why there is a mosque in every state of our union, and over 1,200 mosques within our borders. That is why the US government has gone to court to protect the right of women and girls to wear the hijab, and to punish those who would deny it.

So let there be no doubt: Islam is a part of America. And I believe that America holds within her the truth that regardless of race, religion, or station in life, all of us share common aspirations – to live in peace and security; to get an education and to work with dignity; to love our families, our communities, and our God. These things we share. This is the hope of all humanity.

Of course, recognising our common humanity is only the beginning of our task. Words alone cannot meet the needs of our people. These needs will be met only if we act boldly in the years ahead; and if we understand that the challenges we face are shared, and our failure to meet them will hurt us all.

For we have learned from recent experience that when a financial system weakens in one country, prosperity is hurt everywhere. When a new flu infects one human being, all are at risk. When one nation pursues a nuclear weapon, the risk of nuclear attack rises for all nations. When violent extremists operate in one stretch of mountains, people are endangered across an ocean. And when innocents in Bosnia and Darfur are slaughtered, that is a stain on our collective conscience. That is what it means to share this world in the 21st century. That is the responsibility we have to one another as human beings.

This is a difficult responsibility to embrace. For human history has often been a record of nations and tribes subjugating one another to serve their own interests. Yet in this new age, such attitudes are self-defeating. Given our interdependence, any world order that elevates one nation or group of people over another will inevitably fail. So whatever we think of the past, we must not be prisoners of it. Our problems must be dealt with through partnership; progress must be shared.

That does not mean we should ignore sources of tension. Indeed, it suggests the opposite: we must face these tensions squarely. And so in that spirit, let me speak as clearly and plainly as I can about some specific issues that I believe we must finally confront together.

The first issue that we have to confront is violent extremism in all of its forms.

In Ankara, I made clear that America is not – and never will be – at war with Islam. We will, however, relentlessly confront violent extremists who pose a grave threat to our security. Because we reject the same thing that people of all faiths reject: the killing of innocent men, women, and children. And it is my first duty as president to protect the American people.

The situation in Afghanistan demonstrates America's goals, and our need to work together. Over seven years ago, the United States pursued al-Qaida and the Taliban with broad international support. We did not go by choice, we went because of necessity. I am aware that some question or justify the events of 9/11. But let us be clear: al-Qaida killed nearly 3,000 people on that day. The victims were innocent men, women and children from America and many other nations who had done nothing to harm anybody. And yet al-Qaida chose to ruthlessly murder these people, claimed credit for the attack, and even now states their determination to kill on a massive scale. They have affiliates in many countries and are trying to expand their reach. These are not opinions to be debated; these are facts to be dealt with.

Make no mistake: we do not want to keep our troops in Afghanistan. We seek no military bases there. It is agonising for America to lose our young men and women. It is costly and politically difficult to continue this conflict. We would gladly bring every single one of our troops home if we could be confident that there were not violent extremists in Afghanistan and Pakistan determined to kill as many Americans as they possibly can. But that is not yet the case.

That's why we're partnering with a coalition of 46 countries. And despite the costs involved, America's commitment will not weaken. Indeed, none of us should tolerate these extremists. They have killed in many countries. They have killed people of different faiths – more than any other, they have killed Muslims. Their actions are irreconcilable with the rights of human beings, the progress of nations, and with Islam. The Holy Koran teaches that whoever kills an innocent, it is as if he has killed all mankind; and whoever saves a person, it is as if he has saved all mankind. The enduring faith of over a billion people is so much bigger than the narrow hatred of a few. Islam is not part of the problem in combating violent extremism – it is an important part of promoting peace.

We also know that military power alone is not going to solve the problems in Afghanistan and Pakistan. That is why we plan to invest $1.5bn (£914m) each year over the next five years to partner with Pakistanis to build schools and hospitals, roads and businesses, and hundreds of millions to help those who have been displaced. And that is why we are providing more than $2.8bn to help Afghans develop their economy and deliver services that people depend upon.

Let me also address the issue of Iraq. Unlike Afghanistan, Iraq was a war of choice that provoked strong differences in my country and around the world. Although I believe that the Iraqi people are ultimately better off without the tyranny of Saddam Hussein, I also believe that events in Iraq have reminded America of the need to use diplomacy and build international consensus to resolve our problems whenever possible. Indeed, we can recall the words of Thomas Jefferson, who said: "I hope that our wisdom will grow with our power, and teach us that the less we use our power the greater it will be."

Today, America has a dual responsibility: to help Iraq forge a better future – and to leave Iraq to Iraqis. I have made it clear to the Iraqi people that we pursue no bases, and no claim on their territory or resources. Iraq's sovereignty is its own. That is why I ordered the removal of our combat brigades by next August. That is why we will honour our agreement with Iraq's democratically elected government to remove combat troops from Iraqi cities by July, and to remove all our troops from Iraq by 2012. We will help Iraq train its security forces and develop its economy. But we will support a secure and united Iraq as a partner, and never as a patron.

And finally, just as America can never tolerate violence by extremists, we must never alter our principles. 9/11 was an enormous trauma to our country. The fear and anger that it provoked was understandable, but in some cases, it led us to act contrary to our ideals. We are taking concrete actions to change course. I have unequivocally prohibited the use of torture by the United States, and I have ordered the prison at Guantánamo Bay closed by early next year.

So America will defend itself, respectful of the sovereignty of nations and the rule of law. And we will do so in partnership with Muslim communities which are also threatened. The sooner the extremists are isolated and unwelcome in Muslim communities, the sooner we will all be safer.

The second major source of tension that we need to discuss is the situation between Israelis, Palestinians and the Arab world.

America's strong bonds with Israel are well known. This bond is unbreakable. It is based upon cultural and historical ties, and the recognition that the aspiration for a Jewish homeland is rooted in a tragic history that cannot be denied.

Around the world, the Jewish people were persecuted for centuries, and antisemitism in Europe culminated in an unprecedented Holocaust. Tomorrow, I will visit Buchenwald, which was part of a network of camps where Jews were enslaved, tortured, shot and gassed to death by the Third Reich. Six million Jews were killed – more than the entire Jewish population of Israel today. Denying that fact is baseless, ignorant, and hateful. Threatening Israel with destruction – or repeating vile stereotypes about Jews – is deeply wrong, and only serves to evoke in the minds of Israelis this most painful of memories while preventing the peace that the people of this region deserve.

On the other hand, it is also undeniable that the Palestinian people – Muslims and Christians – have suffered in pursuit of a homeland. For more than 60 years they have endured the pain of dislocation. Many wait in refugee camps in the West Bank, Gaza, and neighbouring lands for a life of peace and security that they have never been able to lead. They endure the daily humiliations – large and small – that come with occupation. So let there be no doubt: the situation for the Palestinian people is intolerable. America will not turn our backs on the legitimate Palestinian aspiration for dignity, opportunity, and a state of their own.

For decades, there has been a stalemate: two peoples with legitimate aspirations, each with a painful history that makes compromise elusive. It is easy to point fingers – for Palestinians to point to the displacement brought by Israel's founding and for Israelis to point to the constant hostility and attacks throughout its history from within its borders as well as beyond. But if we see this conflict only from one side or the other, then we will be blind to the truth: the only resolution is for the aspirations of both sides to be met through two states, where Israelis and Palestinians each live in peace and security.

That is in Israel's interest, Palestine's interest, America's interest, and the world's interest. That is why I intend to personally pursue this outcome with all the patience that the task requires. The obligations that the parties have agreed to under the road map are clear. For peace to come, it is time for them – and all of us – to live up to our responsibilities.

Palestinians must abandon violence. Resistance through violence and killing is wrong and does not succeed. For centuries, black people in America suffered the lash of the whip as slaves and the humiliation of segregation. But it was not violence that won full and equal rights. It was a peaceful and determined insistence upon the ideals at the centre of America's founding. This same story can be told by people from South Africa to South Asia; from eastern Europe to Indonesia. It's a story with a simple truth: that violence is a dead end. It is a sign of neither courage nor power to shoot rockets at sleeping children, or to blow up old women on a bus. That is not how moral authority is claimed; that is how it is surrendered.

Now is the time for Palestinians to focus on what they can build. The Palestinian Authority must develop its capacity to govern, with institutions that serve the needs of its people. Hamas does have support among some Palestinians, but they also have responsibilities. To play a role in fulfilling Palestinian aspirations, and to unify the Palestinian people, Hamas must put an end to violence, recognise past agreements, and recognise Israel's right to exist.

At the same time, Israelis must acknowledge that just as Israel's right to exist cannot be denied, neither can Palestine's. The United States does not accept the legitimacy of continued Israeli settlements. This construction violates previous agreements and undermines efforts to achieve peace. It is time for these settlements to stop.

Israel must also live up to its obligations to ensure that Palestinians can live, and work, and develop their society. And just as it devastates Palestinian families, the continuing humanitarian crisis in Gaza does not serve Israel's security; neither does the continuing lack of opportunity in the West Bank. Progress in the daily lives of the Palestinian people must be part of a road to peace, and Israel must take concrete steps to enable such progress.

Finally, the Arab states must recognize that the Arab Peace Initiative was an important beginning, but not the end of their responsibilities. The Arab-Israeli conflict should no longer be used to distract the people of Arab nations from other problems. Instead, it must be a cause for action to help the Palestinian people develop the institutions that will sustain their state; to recognise Israel's legitimacy; and to choose progress over a self-defeating focus on the past.

America will align our policies with those who pursue peace, and say in public what we say in private to Israelis and Palestinians and Arabs. We cannot impose peace. But privately, many Muslims recognise that Israel will not go away. Likewise, many Israelis recognise the need for a Palestinian state. It is time for us to act on what everyone knows to be true.

Too many tears have flowed. Too much blood has been shed. All of us have a responsibility to work for the day when the mothers of Israelis and Palestinians can see their children grow up without fear; when the Holy Land of three great faiths is the place of peace that God intended it to be; when Jerusalem is a secure and lasting home for Jews and Christians and Muslims, and a place for all of the children of Abraham to mingle peacefully together as in the story of Isra, when Moses, Jesus, and Mohammed (peace be upon them) joined in prayer.

The third source of tension is our shared interest in the rights and responsibilities of nations on nuclear weapons.

This issue has been a source of tension between the United States and the Islamic Republic of Iran. For many years, Iran has defined itself in part by its opposition to my country, and there is indeed a tumultuous history between us. In the middle of the cold war, the United States played a role in the overthrow of a democratically elected Iranian government. Since the Islamic revolution, Iran has played a role in acts of hostage-taking and violence against US troops and civilians. This history is well known. Rather than remain trapped in the past, I have made it clear to Iran's leaders and people that my country is prepared to move forward. The question, now, is not what Iran is against, but rather what future it wants to build.

It will be hard to overcome decades of mistrust, but we will proceed with courage, rectitude and resolve. There will be many issues to discuss between our two countries, and we are willing to move forward without preconditions on the basis of mutual respect. But it is clear to all concerned that when it comes to nuclear weapons, we have reached a decisive point. This is not simply about America's interests. It is about preventing a nuclear arms race in the Middle East that could lead this region and the world down a hugely dangerous path.

I understand those who protest that some countries have weapons that others do not. No single nation should pick and choose which nations hold nuclear weapons. That is why I strongly reaffirmed America's commitment to seek a world in which no nations hold nuclear weapons. And any nation – including Iran – should have the right to access peaceful nuclear power if it complies with its responsibilities under the nuclear non-proliferation treaty. That commitment is at the core of the treaty, and it must be kept for all who fully abide by it. And I am hopeful that all countries in the region can share in this goal.

The fourth issue that I will address is democracy.

I know there has been controversy about the promotion of democracy in recent years, and much of this controversy is connected to the war in Iraq. So let me be clear: no system of government can or should be imposed upon one nation by any other.

That does not lessen my commitment, however, to governments that reflect the will of the people. Each nation gives life to this principle in its own way, grounded in the traditions of its own people. America does not presume to know what is best for everyone, just as we would not presume to pick the outcome of a peaceful election. But I do have an unyielding belief that all people yearn for certain things: the ability to speak your mind and have a say in how you are governed; confidence in the rule of law and the equal administration of justice; government that is transparent and doesn't steal from the people; the freedom to live as you choose. Those are not just American ideas, they are human rights, and that is why we will support them everywhere.

There is no straight line to realise this promise. But this much is clear: governments that protect these rights are ultimately more stable, successful and secure. Suppressing ideas never succeeds in making them go away. America respects the right of all peaceful and law-abiding voices to be heard around the world, even if we disagree with them. And we will welcome all elected, peaceful governments – provided they govern with respect for all their people.

This last point is important because there are some who advocate for democracy only when they are out of power; once in power, they are ruthless in suppressing the rights of others. No matter where it takes hold, government of the people and by the people sets a single standard for all who hold power: you must maintain your power through consent, not coercion; you must respect the rights of minorities, and participate with a spirit of tolerance and compromise; you must place the interests of your people and the legitimate workings of the political process above your party. Without these ingredients, elections alone do not make true democracy.

The fifth issue that we must address together is religious freedom.

Islam has a proud tradition of tolerance. We see it in the history of Andalusia and Cordoba during the Inquisition. I saw it first-hand as a child in Indonesia, where devout Christians worshipped freely in an overwhelmingly Muslim country. That is the spirit we need today. People in every country should be free to choose and live their faith based upon the persuasion of the mind, heart, and soul. This tolerance is essential for religion to thrive, but it is being challenged in many different ways.

Among some Muslims, there is a disturbing tendency to measure one's own faith by the rejection of another's. The richness of religious diversity must be upheld – whether it is for Maronites in Lebanon or the Copts in Egypt. And fault lines must be closed among Muslims as well, as the divisions between Sunni and Shia have led to tragic violence, particularly in Iraq.

Freedom of religion is central to the ability of peoples to live together. We must always examine the ways in which we protect it. For instance, in the United States, rules on charitable giving have made it harder for Muslims to fulfill their religious obligation. That is why I am committed to working with American Muslims to ensure that they can fulfil zakat.

Likewise, it is important for western countries to avoid impeding Muslim citizens from practising religion as they see fit– for instance, by dictating what clothes a Muslim woman should wear. We cannot disguise hostility towards any religion behind the pretence of liberalism.

Indeed, faith should bring us together. That is why we are forging service projects in America that bring together Christians, Muslims, and Jews. That is why we welcome efforts like Saudi Arabian King Abdullah's Interfaith dialogue and Turkey's leadership in the Alliance of Civilizations. Around the world, we can turn dialogue into interfaith service, so bridges between peoples lead to action– whether it is combating malaria in Africa, or providing relief after a natural disaster.

The sixth issue that I want to address is women's rights.

I know there is debate about this issue. I reject the view of some in the west that a woman who chooses to cover her hair is somehow less equal, but I do believe that a woman who is denied an education is denied equality. And it is no coincidence that countries where women are well-educated are far more likely to be prosperous.

Now let me be clear: issues of women's equality are by no means simply an issue for Islam. In Turkey, Pakistan, Bangladesh and Indonesia, we have seen Muslim-majority countries elect a woman to lead. Meanwhile, the struggle for women's equality continues in many aspects of American life, and in countries around the world.

Our daughters can contribute just as much to society as our sons, and our common prosperity will be advanced by allowing all humanity – men and women – to reach their full potential. I do not believe that women must make the same choices as men in order to be equal, and I respect those women who choose to live their lives in traditional roles. But it should be their choice. That is why the United States will partner with any Muslim-majority country to support expanded literacy for girls, and to help young women pursue employment through micro-financing that helps people live their dreams.

Finally, I want to discuss economic development and opportunity.

I know that for many, the face of globalisation is contradictory. The internet and television can bring knowledge and information, but also offensive sexuality and mindless violence. Trade can bring new wealth and opportunities, but also huge disruptions and changing communities. In all nations – including my own – this change can bring fear. Fear that because of modernity we will lose of control over our economic choices, our politics, and most importantly our identities – those things we most cherish about our communities, our families, our traditions, and our faith.

But I also know that human progress cannot be denied. There need not be contradiction between development and tradition. Countries like Japan and South Korea grew their economies while maintaining distinct cultures. The same is true for the astonishing progress within Muslim-majority countries from Kuala Lumpur to Dubai. In ancient times and in our times, Muslim communities have been at the forefront of innovation and education.

This is important because no development strategy can be based only upon what comes out of the ground, nor can it be sustained while young people are out of work. Many Gulf States have enjoyed great wealth as a consequence of oil, and some are beginning to focus it on broader development. But all of us must recognise that education and innovation will be the currency of the 21st century, and in too many Muslim communities there remains underinvestment in these areas. I am emphasising such investments within my country. And while America in the past has focused on oil and gas in this part of the world, we now seek a broader engagement.

On education, we will expand exchange programmes, and increase scholarships, like the one that brought my father to America, while encouraging more Americans to study in Muslim communities. And we will match promising Muslim students with internships in America; invest in online learning for teachers and children around the world; and create a new online network, so a teenager in Kansas can communicate instantly with a teenager in Cairo.

On economic development, we will create a new corps of business volunteers to partner with counterparts in Muslim-majority countries. And I will host a summit on entrepreneurship this year to identify how we can deepen ties between business leaders, foundations and social entrepreneurs in the United States and Muslim communities around the world.

On science and technology, we will launch a new fund to support technological development in Muslim-majority countries, and to help transfer ideas to the marketplace so they can create jobs. We will open centres of scientific excellence in Africa, the Middle East and south-east Asia, and appoint new science envoys to collaborate on programmes that develop new sources of energy, create green jobs, digitise records, clean wate and grow new crops. And today I am announcing a new global effort with the Organisation of the Islamic Conference to eradicate polio. And we will also expand partnerships with Muslim communities to promote child and maternal health.

All these things must be done in partnership. Americans are ready to join with citizens and governments; community organisations, religious leaders, and businesses in Muslim communities around the world to help our people pursue a better life.

The issues that I have described will not be easy to address. But we have a responsibility to join together on behalf of the world we seek – a world where extremists no longer threaten our people, and American troops have come home; a world where Israelis and Palestinians are each secure in a state of their own, and nuclear energy is used for peaceful purposes; a world where governments serve their citizens, and the rights of all God's children are respected. Those are mutual interests. That is the world we seek. But we can only achieve it together.

I know there are many – Muslim and non-Muslim – who question whether we can forge this new beginning. Some are eager to stoke the flames of division, and to stand in the way of progress. Some suggest that it isn't worth the effort – that we are fated to disagree, and civilisations are doomed to clash. Many more are simply skeptical that real change can occur. There is so much fear, so much mistrust. But if we choose to be bound by the past, we will never move forward. And I want to particularly say this to young people of every faith, in every country – you, more than anyone, have the ability to remake this world.

All of us share this world for but a brief moment in time. The question is whether we spend that time focused on what pushes us apart, or whether we commit ourselves to an effort – a sustained effort _ to find common ground, to focus on the future we seek for our children, and to respect the dignity of all human beings.

It is easier to start wars than to end them. It is easier to blame others than to look inward; to see what is different about someone than to find the things we share. But we should choose the right path, not just the easy path. There is also one rule that lies at the heart of every religion – that we do unto others as we would have them do unto us. This truth transcends nations and peoples – a belief that isn't new; that isn't black or white or brown; that isn't Christian, or Muslim or Jew. It's a belief that pulsed in the cradle of civilisation, and that still beats in the heart of billions. It's a faith in other people, and it's what brought me here today.

We have the power to make the world we seek, but only if we have the courage to make a new beginning, keeping in mind what has been written.

The Holy Koran tells u: "O mankind! We have created you male and a female; and we have made you into nations and tribes so that you may know one another."

The Talmud tells us: "The whole of the Torah is for the purpose of promoting peace."

The Holy Bible tells us: "Blessed are the peacemakers, for they shall be called sons of God."

The people of the world can live together in peace. We know that is God's vision. Now, that must be our work here on Earth. Thank you. And may God's peace be upon you.