LONDON (Reuters) - British public opinion on Europe has shifted in the last year and a half with most people now wanting to stay in the European Union rather than leave it, a poll published a week before European elections showed on Thursday.

Prime Minister David Cameron has promised to give Britons an in/out EU membership referendum in 2017 if re-elected next year as he tries to fend off an electoral challenge from the surging anti-EU UK Independence Party (UKIP).

Thursday’s survey, by Ipsos MORI, showed that 54 percent of Britons would vote to remain in the 28-nation bloc if a referendum was held today, while 37 percent would vote to leave.

Last time the pollster asked the same question, in November 2012, 48 percent said they would vote to leave the EU and 44 percent said they would elect to stay in.

Two other polls published in March by another pollster, YouGov, also showed that more voters would back staying in the EU rather than leaving.

“After several years of hostility to Europe after the crash, people seem more willing to stay in the EU - though a reduction in its powers is still more popular than further integration,” Gideon Skinner, Ipsos MORI’s head of political research, said in a statement.

The survey was conducted among 1,003 Britons by phone from May 10-12.

The terms of the Europe debate had changed since 2012, Skinner told Reuters, after Cameron offered to try to renegotiate Britain’s EU ties holding out the possibility that the country could stay in the bloc on different terms.

Euroscepticism in Britain is still strong, however, with UKIP, which wants the country to leave the EU, on course to come first or second in next week’s elections to the European Parliament, according to several polls.