Love thy neighbour, so long as he is not an illegal immigrant. Blessed are the poor, so long as they are deserving. And, though it may be harder for a rich man to enter the kingdom of heaven than to pass through the eye of a needle, multimillionaires should have no problem passing through the door of the Oval Office.

Religion and politics have always made uneasy bedfellows; yet how can Christians from all shades of the political spectrum reconcile their diverse views with the teachings of a single man?

A study led by Lee Ross of Stanford University in California has found that the Jesus of liberal Christians is very different from the one envisaged by conservatives. The researchers asked respondents to imagine what Jesus would have thought about contemporary issues such as taxation, immigration, same-sex marriage and abortion. Perhaps not surprisingly, Christian Republicans imagined a Jesus who tended to be against wealth redistribution, illegal immigrants, abortion and same-sex marriage; whereas the Jesus of Democrat-voting Christians would have had far more liberal opinions. The Bible may claim that God created man in his own image, but the study suggests man creates God in his own image.

Yet both groups recognised that their own views were not always identical to those of Jesus. The researchers divided issues into those concerned with fellowship (wealth distribution, immigration), and those concerned with morality (gay rights, abortion). Conservatives envisaged a Jesus with views close to their own on morality issues; but they recognised that the man who gave all his possessions to the poor would probably have advocated more progressive taxation policies than those of the Republican party. Conversely, liberals saw Jesus as having similar views as themselves on fellowship issues but they believed his views on gay rights would be to the right of their own.

The social psychologist Leon Festinger coined the term "cognitive dissonance" for the discomfort felt when we recognise conflict between our ideas and perceptions. He proposed that we tend to reduce conflict by altering our view of reality. This process of "dissonance reduction" ("I didn't want that job anyway") has been used down the centuries to reduce the conflict between a person's religious convictions and their actions. When in the 13th century the Abbot Arnaud Amaury was asked by crusaders what do with the citizens of the town of Beziers who were a mix of both pious Christians and heretical Albigensians, he famously initiated a massacre of all the town's inhabitants with the instructions, "Kill them all. God will know his own." Similarly, in the 19th century, Christian slavers insisted that the enforced transport and enslavement of millions of Africans was justified because it brought God to a pagan people.

The researchers discovered that conservatives believe Jesus would have prioritised the moral issues close to their own hearts, and that disparities in wealth or the treatment of illegal immigrants wouldn't have been high on his agenda. Liberals believed the opposite.

Ross and his colleagues suggest that dissonance reduction takes place not only within the individual, but as a collective enterprise. Preachers, politicians and co-believers tend to emphasise and de-emphasise different aspects of the Christian canon; so conservative Americans study the Old Testament with its homophobic rhetoric and eye-for-an-eye morality, whereas liberals look to the New Testament Jesus who was sympathetic to the poor and the meek.

Evangelical politics is not, of course, limited to the US. Many social conservatives in the UK align themselves with the Christian right, and MPs such as Nadine Dorries take inspiration from US campaigns against abortion or gay rights. But perhaps the most striking aspect of the study is that it turns on its head the claims by many religious politicians, such as Republican nomination candidates Rick Santorum ("I'm for income inequality"), Rick Perry ("Homosexuality is a sin"), or the UK's Nadine Dorries ("My faith tells me who I am"), that their politics is inspired by their God. This study suggests instead that their God is inspired by their politics.