LONDON — From the prime minister to sports and pop icons David and Victoria Beckham, supporters of Britain staying in the European Union urged voters Tuesday to think about future generations when they cast ballots in a referendum that has divided the nation.

With the black door of 10 Downing St. offering a statesman’s backdrop, Cameron appealed directly to EU-wary older voters, saying that leaving the bloc would risk the country’s economic security – and younger generations would have to live with the consequences.

“Do think about the hopes and dreams of your children and grandchildren,” he said. “They can’t undo the decision we take,” he said. “If we vote out, that’s it. It’s irreversible.”

The plea came as the already heated campaign moved into its tense final days. Opponents said the statement outside the prime minister’s residence betrayed Cameron’s worry that the referendum he called to settle Britain’s place in Europe could end with the country walking away from the bloc.

Steve Hilton, a former Cameron adviser who now backs a “leave” vote, said Cameron had been “wheeled out by rather panicky spin doctors” to appeal for votes.

Cameron seemed to direct his appeal at those who grew up in the after-shadow of Britain’s imperial period, in a nation that had stood against Nazi tyranny during World War II. Polls suggest these voters, many of them Conservatives, are more likely than younger Britons to reject the pan-European EU project.

Cameron tried to assure them that Britain remains a great country – even if it is part of a 28-nation bloc – and that being in the EU allows the country to promote the values it holds dear.

“Brits don’t quit,” he said. “We get involved, we take a lead. We make a difference. We get things done.”

Cameron acknowledged that many Britons didn’t vote for him and don’t like him.

“Not everyone has been happy with what I have done,” he said. “But of this I am convinced … Britain is better off inside the EU than out on our own.”

The “remain” camp also got a boost from more popular – and populist – figures when soccer star David Beckham and his designer wife Victoria added their voices to the EU cause.

“For our children and their children, we should be facing the problems of the world together and not alone,” he said.

Former Spice Girl Victoria Beckham later registered her view by posting the symbol of the “Stronger In” campaign on her Instagram page.

Both sides in the referendum were trying to keep things positive, wary that negative campaigning would turn off voters.