When David Cameron first became Tory leader he warned his party to stop "banging on about Europe."
Since then he has repeatedly ruled out holding a referendum and has repeatedly urged the Tories to move back to the centre ground of British politics.
So why has Cameron suddenly announced an EU referendum? Why is he suddenly so keen to bang on about a subject that even he says he doesn't want to talk about.
The truth is that the only thing that has really changed is Cameron’s own position in his party.
A year ago the Tories were up to five per cent ahead in the polls. Now they’re five per cent behind.
A year ago Cameron had a reasonable chance of winning an overall majority at the next election. Now he has very little chance.
But instead of focusing on the millions of people who have switched to voting Labour or to not voting at all, Cameron has instead decided to chase after the relatively small number who now vote for Ukip instead.
"I don’t want us to leave Europe, Cameron seemed to say, which is exactly why I’m going to offer you the chance to leave it anyway."
Today in a tie of purest Ukip purple, Cameron talked about a “plague” of EU regulation and warned that Britain would “drift towards the exit” unless the EU hands us back more powers.
I don’t want us to leave Europe, Cameron seemed to say, which is exactly why I’m going to offer you the chance to leave it anyway.
I don’t want to waste time banging on about Europe, which is exactly why I’m going to bang on about it for the next four years.
And yet in the short term David Cameron’s gamble could pay off.
By arguing against a referendum, Labour is now in the impossible position of calling for the public to be denied a democratic choice.
And while his promise today may not win Cameron many voters directly, failing to deal with the growing discontent in his party would certainly have lost him many more.
If Cameron had failed to unite his party, then he could have faced a leadership challenge. This in turn would have killed off any chances he had left of winning the next election.
Yet every month that Cameron spends banging on about Europe is another month that he fails to deal with the issues that voters really do care about.
The fate of the European working time directive and EU fisheries policy does not keep many voters awake at night. The fate of people's jobs and homes does.
Cameron had little choice but to give the speech that he did today, and it will certainly shore up his own position.
But the planned referendum will only take place if the Tories can win a majority at the next election.
And unless they now focus on the issues that the public really do care about, then their dream of a referendum will remain just that.
- Adam Bienkov is a freelance journalist and political blogger