To those who have met him, Pope Francis radiates an immediate warmth and a simple personal holiness. But five years into his papacy, it is also clear that the current Pope is an astute political operator. In one sense, this is nothing new. It goes with the job. The Catholic Church he leads is the oldest and largest organisation in the world – and it has a long history of engagement with worldly politics.

The faithful greet and take photos of Pope Francis as he arrives for the weekly general audience at Paul-VI hall in the Vatican. Andreas Solaro / AFP

Those who claim that religion and politics should be kept separate know little of the history of a religion whose founder, Jesus Christ, was executed by the secular and religious authorities of his time because they saw him as a threat to civic order. At least one of the disciples of Jesus is thought to have been a dagger-carrying Zealot – the militant group which set out to incite the Jewish people to rebel against the Roman empire which dominated the world order of that era. For the first four centuries, the followers of Christ were a fringe sect who were persecuted by the authorities because their singular devotion to God was regarded as a challenge to the power of an imperial Rome whose emperors accorded themselves divine status.

There was an irony in that. For 400 years after the birth of Jesus, the Emperor Constantine made Christianity legal, paving the way for it to become the official religion of the empire which dominated the world. For more than a thousand years thereafter, the Catholic Church, through the institution of Christendom, held itself in alliance with the monarchs of Europe, creating, through the feudal system, its own world order, in which religion held such sway it bordered on theocracy.

On Christmas Day in the year 800, Pope Leo III crowned the King of the Franks, Charlemagne, as the first Holy Roman Emperor. The alliance between papacy and monarchy was to prove uneasy. Pope and emperor vied for power for almost a millennium until the Holy Roman Empire was dissolved during the Napoleonic wars.

But it was during the five centuries after the crowning of Charlemagne that the rivalry was at its height. The contest was most fierce during what was called the Investiture Controversy, when popes and emperors disputed who should appoint bishops within the empire. It ended in victory for the papacy when the Emperor Henry IV in 1077 walked for three days and stood barefoot in the snow to beg forgiveness from Pope Gregory VII.

From the 8th century to the 18th, popes actually held territories in Italy and ruled them like kings. Some even led troops into battle. But the power of the papacy went far beyond that. All across Europe, the Church taxed the ordinary population through tithes. Ecclesiastical courts were as powerful as secular ones. The Church dominated almost every aspect of medieval life. Its codes of morality ruled the lives of an entire continent.

Even a practice as secular as war was governed by rules established by churchmen. The great mediaeval theologian Thomas Aquinas codified a doctrine called Just War, which set out the ethics of the battlefield, insisting that war could only be declared by a state for a good purpose rather than for selfish gain, and with the aim of creating a lasting peace.

It was only after the Protestant Reformation broke the stranglehold of Catholicism – and the new modes of thinking of the Enlightenment challenged the religious world view with its rationalism – that the Church had to alter its political style. After the French Revolution, it was forced onto the defensive by a tide of anti-clericalism which swept Europe. By the following century, in the 1870s in Germany, the Prussian Chancellor Otto von Bismarck instituted what he called a “Kulturkampf” (culture struggle) with the Catholic Church, in an effort to curb the pope’s influence over German politics and to weaken Catholic institutions in a country where one third of the population was Catholic.

The Church then switched to the exercise of soft power. In 1891 Pope Leo XIII issued the first Catholic social encyclical, Rerum Novarum (Of New Things). Its aim was to set out a middle way between the cruel capitalism of the industrial revolution and the new notions of communism which the Pope feared might take hold in the minds of the people of Europe. The idea was to increase social justice while dissuading Catholic workers from allying themselves with socialist movements.

In the century which has passed since then, popes have produced more than a dozen social encyclicals expanding the range of Church teaching beyond Christian faith and morality and into social, economic, political and cultural issues.

Out of those early social encyclicals grew strong Catholic political movements in Spain, Italy, Germany, Austria, Ireland, France and Latin America. During the worldwide economic depression which followed the 1929 Wall Street crash, mass unemployment and widespread deprivation encouraged the growth through the 1930s of fascist movements in Italy, Germany and Spain.

These drew on ideas set out in 1931 by Pope Pius XI in the encyclical Quadragesimo Anno, proposing a grand corporate plan for the reconstruction of the social order, which would do away with class struggle between bosses and workers, and promote harmonious co-operation within industries and professions in its place. It proved a template for national socialism.

A commemoration of the Lateran Treaty of 1929. From left to right: Victor Emmanuel III; Mussolini and Pope Pius XI. Roger Viollet / Getty

Mistakenly, the Church tried to do deals with these regimes. In Italy the Pope signed the Lateran Treaty with Benito Mussolini, who granted the territory today known as Vatican City to the Pope in return for a papal pledge of political neutrality. In Germany it signed the Reichskonkordat with Hitler, which led to the dissolution of the Catholic Centre Party, one of the major obstacles to Hitler's path to power; in return the Church was granted the right to worship without interference. In Spain the Church backed the fascist Franco against his Communist opponents in a bloody civil war. In Argentina, the native land of Pope Francis, the Church entered into an alliance with the military and the trade unions under General Peron.

It was an inglorious period in Church history, which ended with Pope Pius XII being widely condemned for failing to speak out publicly against Hitler's genocidal attack on the Jews, even though privately the Pope had informed Allied intelligence of which generals were plotting against Hitler and worked behind the scenes to hide tens of thousands of Jews in religious houses in Italy and in the Vatican itself. The full picture has still not emerged from the secret Vatican archives.

After that the Church learned to exercise its political power more indirectly but more publicly. Before the war, the Russian dictator Joseph Stalin had joked: "How many divisions has the Pope?” Ironically the power of the papacy was to outlast that of Communist Russia. But it became more subtle in its manifestation.

In the 1960s a revolution occurred within the Catholic Church. The Second Vatican Council shifted from a quiet focus on its own inner sacramental life. Instead it threw open the windows of the Church, seeking greater interaction with, and influence on, secular society. A new theology, more in tune with the democratic temper of the times, and more aligned with the post-war emphasis on universal human rights, was expounded. As Catholic social teaching developed, it emphasised the dignity of every human being, the rights of all to make their own choices rather than having them imposed from on high, the responsibility of everyone to their fellows, and the need to pursue a common good.

In Latin America such teaching was taken to heart in the 1970s with the growth of liberation theology. This insisted that the social, economic and spiritual liberation of poor people were inseparable. Priests went out to live in the slums to encourage the poor to read the Bible and apply it to their own lives. But the movement was frowned upon by theological authoritarians in Rome and right-wing politicians in the US, who feared it would usher in communism through the back door.

Under Pope Paul VI, an unholy alliance between the Vatican and the American secret service was formed to counter this empowerment of the poor. Liberation theology, they insisted, was Marxist, a threat to Catholic orthodoxy and to the power of the Vatican hierarchy. A clandestine unit was set up by the CIA. Between 1973 and 1979, it passed money to conservative bishops and priests – and informed on radical priests and nuns to Latin America's military dictators who murdered thousands of them.

The collaboration continued under the next pope, John Paul II, who met many times with the American president Ronald Reagan. The pair shared a detestation of communism and worked covertly together to undermine the Soviet-backed regime in the Pope's native Poland. They used the trade union Solidarity as a lever to trigger the collapse of communism across Eastern Europe. The US provided the funds and the equipment. Catholic priests helped move supplies and carry messages.

The political priorities of each pope vary with their personal backgrounds. John Paul II was a Polish pope who would been brought up under totalitarian regimes, first Nazi and then communist. That shaped his authoritarian world view. Pope Francis, by contrast, is the first Latin American Pope. He sees the world with different eyes.

For decades, he moved among the very poorest people in the slums of Buenos Aires. Their lives at the bottom of the economic heap had been blighted by a savage capitalism nurtured by the economic policies of their rich neighbour to the north, the US. It was unsurprising, then, when Pope Francis's first major international initiatives was to encourage then president Barack Obama to end America's 50-year cold war with the island of Cuba. After private discussions with Mr Obama, the Pope ordered Vatican diplomats to broker secret peace talks between the US and Cuba. When the talks, which were held in Canada, faltered, Pope Francis personally offered to act as a guarantor of the good faith of each side to restart them.

Pope Francis blesses people as he leads a mass in the Latin church near the River Jordan in Bethany, the site of Christ's baptism, west of Amman, Jordan. Jordan Pix /Getty

But if Pope Francis is a careful diplomat, he can also be an outspoken critic. Just ahead of his visit to the US in 2015, he issued a social encyclical entitled Laudato si’. It was a devastating indictment of the way that unregulated modern capitalism – which has its epicentre in the country he was just about to visit – is destroying the planet and exploiting the poor. Man-made climate change and our "throwaway culture" are part of a deeply materialist culture. “Such an economy kills,” the Pope’s document bluntly puts it.

Yet if international statesmanship requires bold statements and grand gestures, Pope Francis knows that it also needs what he has called in Italian “piccoli passi” – baby steps. Inching the needle forward was what the Pope was trying to do when he invited the presidents of Israel and the Palestinians to a prayer summit at the Vatican after his visit to the Holy Land in 2014. International observers were sceptical. But the fruits of peace do not fall suddenly.

Pope Francis has adopted a similar slowly-slowly strategy with China, with which the Vatican has been locked in a decades-old impasse over the control of China’s 12 million Catholics – half of whom are members of underground churches loyal to Rome and half of whom belong to a government-sponsored church with bishops appointed by the Chinese Communist Party. Intriguingly, under Pope Francis, the Vatican signed an historic compromise agreement with Beijing on the appointment of Catholic bishops. Some in the Church feel the Pope has conceded too much, but the Pope sees it as another work in progress. It is just one of a number of areas on which his political strategy is to nudge.

Pope Francis in the Vatican. Maurizio Bramatti / EPA

Much of the geopolitical influence of the Catholic Church in the modern world is even more indirect. It has a major aid and development charity raising money in 165 nations for projects in more than 200 countries. A quarter of all the hospitals in Africa are Catholic; so are the schools in which 12 million children learn. Globally the Church runs more than 5000 hospitals, 15,000 homes for the elderly, and tens of thousands of schools. It is the world's biggest NGO.

It is the only religious body to have an official presence at the United Nations, where it has observer status. And it is the only faith organisation to have a diplomatic corps with full ambassadorial relations with 183 states – including, uniquely, both Israel and Palestine. Its diplomats have played an active role in international activities, from arms-reduction negotiations to talks on climate change.

Pope Francis (R) at his weekly general audience at Paul-VI hall in the Vatican. Andreas Solaro / AFP

Earlier this month, Pope Francis summoned the ambassadors of 183 countries to the Vatican and addressed them on his political agenda for the year. He recalled Pope Paul VI’s historic speech to the United Nations in 1965, which called for action in four key international areas – action which is still very much needed today if peace is to be brought to our troubled world.

The first was the promotion of justice and law. Here Pope Francis lamented "the re-emergence of tendencies to impose and pursue individual national interests without having recourse to the instruments provided by international law for resolving controversies”. The second was "the defence of the most vulnerable", which the Pope saw was everywhere from eastern Ukraine to Venezuela and to war-torn Syria – and on which he praised Colombia, Jordan and Lebanon for taking in so many refugees. The international community needed to follow that example, he said, and provide assistance to economic migrants as well as victims of violence and persecution.

Pope Francis praised the role of the United Nations in the third key area for international action – acting as “a bridge between peoples and builders of peace”. He applauded "positive signs" for peace in Korea, South Sudan, Ethiopia and Eritrea and expressed concern over the Democratic Republic of the Congo, the Yemen and the "fundamentalist violence" in Mali, Niger and Nigeria. And the Pope again continued publicly to advocate a two-state solution in Israel and Palestine, despite moves by the US president Donald Trump in the opposite direction.

Finally, he told the diplomats, the fourth key area was the need “to rethink our common destiny”. He worried that the US and Russia might be about to revive the international arms race "with increasingly sophisticated and destructive weapons". On climate change, he reiterated, we need "to rethink our relationship with our planet" and called for a more decisive commitment by all nations to tackle global warming.

Pope Francis made specific reference to his forthcoming visits to the United Arab Emirates and Morocco, which he said offered "important opportunities to advance interreligious dialogue and mutual understanding". He expressed particular concern for the plight of the Christian population in the Middle East, saying: "It is extremely important that Christians have a place in the future of the region”.

When the leader of the world's 1.2 billion Catholics arrives in the UAE, it will be with a pastoral warmth, a readiness to listen, a deep spirituality – but be prepared, too, to welcome a shrewd and demanding global politician.

Paul Vallely is the author of the biography Pope Francis – the Struggle for the Soul of Catholicism, published by Bloomsbury, and the editor of Catholic Social Teaching for the Twenty-First Century, published by SCM press