BIRMINGHAM -- British Prime Minister Theresa May has poked fun at her limited dance moves as she arrived onstage at the Conservative Party conference with ABBA's "Dancing Queen" blasting over the speakers.

May awkwardly took a spin around, robotically pumped her arms in the air on Wednesday and had a brief laugh at her own expense before a key speech. It was a nod to her much-mocked boogie during a trip to Africa earlier this year.

The Conservative Party crowd roared and cheered.

Get Breaking News Delivered to Your Inbox

May also joked about her disastrous speech to the conference last year, in which she couldn't stop coughing and a sign fell behind her. But she quickly switched to a somber tone, taking on the task of staying in power in light of her troubled Brexit policy.

Warning the party to abandon dreams of a "perfect" Brexit, May urged her party to back her as divorce negotiations with the European Union enter their "toughest" final phase.

She said that "leaving without a deal - introducing tariffs and costly checks at the border - would be a bad outcome for the U.K. and the EU" - though she refused to rule it out.

Just six months before Britain leaves the European Union on March 29, negotiations have ground to a halt and May is caught between Brexiteers like rival Boris Johnson and those who want to keep close economic ties with the bloc, Britain's biggest trading partner.

May used a punchy speech to lay down a challenge to her detractors, a day after Johnson trashed her Brexit plan and challenged her authority with a crowd-pleasing speech of his own.

May ended the governing Conservatives' annual conference with a call for the party to show that it "delivers on the issues (voters) care about and is comfortable with modern Britain in all its diversity."

The four-day conference has been dominated by divisions over Britain's impending departure from the European Union, with pro- and anti-EU camps both criticizing the prime minister's negotiations with the bloc.

Johnson, who quit as foreign secretary in July, drew cheers from 1,500 delegates on Tuesday when he called May's proposal for close post-Brexit economic ties an "outrage" that would leave Britain manacled to the EU and unable to strike new trade deals around the world.

May acknowledged that Johnson's speech had made her "cross" but said she was sticking to her Brexit blueprint, which would keep Britain aligned to many EU rules in return for remaining in the bloc's single market for goods.

She argues that her plan is the only way to avoid customs checks along the currently invisible border between the U.K.'s Northern Ireland and EU member Ireland - a development that would be troublesome for residents and businesses on both sides, and could undermine Northern Ireland's peace process.

But the EU is demanding new proposals from Britain before it signs a deal - and many Conservatives are in no mood to compromise.

May has had a tough year since a disastrous 2017 conference speech, when she was plagued by a cough and interrupted by a prankster while parts of the backdrop fell down as she was speaking.

In a nod to voters who are tired of stagnating wages and spending cuts, May said that from next year the government would end the austerity policies introduced after the 2008 global financial crisis and put more money into public services.

She painted an optimistic picture of post-Brexit Britain, saying "I passionately believe that our best days lie ahead of us and that our future is full of promise."

Her own future remains full of uncertainty. Johnson's speech was a leadership pitch in all but name, and many Conservatives expect May to face a party coup soon after Brexit day - or even before, if there is no progress toward a deal.

Conservative lawmaker James Duddridge on Wednesday called the Brexit negotiations "an absolute disaster" and said Johnson's speech had been "inspirational."

"We need a strong leader and we haven't got that at the moment," Duddridge told the BBC.

"My support for her is wearing thin to the point of being invisible."