London (CNN) British Prime Minister Theresa May committed to placing a final Brexit deal to a vote in both houses of the UK parliament, as she outlined for the first time her plan for extracting Britain from the European Union.

In a much-anticipated speech in London, May said that once Britain had negotiated a final deal to leave the European Union, it would be placed before the House of Commons and the House of Lords for approval.

In language that indicated a "hard Brexit", May confirmed that Britain would leave the EU single market, which guarantees the free movement of goods, services and people within the bloc. The Prime Minister made it clear that her fundamental aim was regain full control of immigration and lawmaking -- and that leaving the single market was the inevitable consequence.

Britain could not be "half-in, half-out" of the EU, the Prime Minister said.

But she revealed that, in the forthcoming negotiations with the EU, Britain would seek an arrangement to replace the provisions of the EU customs union. Such a deal could amount to "associatere membership" of the customs union, she said.

May also warned other EU member states not to seek a "punitive" deal for Britain in order to send a message to Euroskeptics in other countries. Such a move would be a "calamitous act of self-harm," she said.

"No deal for Britain is better than a bad deal for Britain," May declared.

Parliament given vote

What May said: The Prime Minister revealed for the first time that the British government will put the final Brexit deal to a vote, meaning that members of the UK parliament could, in theory, block the deal. When asked by reporters what would happen in that scenario, May avoided a direct answer. "I am sure the British Parliament will want to deliver the views of the British people and respect the democratic decision that was taken," she said.

But negotiations on a deal can't even begin until the British government invokes Article 50 of the Lisbon Treaty, which sets the rules of EU membership. May has said she wants to trigger the mechanism by the end of March, and did not seek to alter that timetable in her speech.

The UK Supreme Court is due to rule in the next few weeks on whether there must be another vote in the UK parliament before that can happen. Negotiations must then be concluded within two years.

Britain's Prime Minister Theresa May delivers a speech on leaving the European Union at Lancaster House in London.

What it means: Two years is a long time in British politics, and it's hard to predict the outcome of a parliamentary vote before talks have even started on a deal. But analysts expect that, if there is not a general election in the meantime, May would prevail.

"There are so many unknowns," Quentin Peel, associate fellow of the Europe Program at the Chatham House think tank, told CNN. "Are we going to have an election before it gets to that stage? What will the make up of the House of Commons be?"

Peel noted that May refused to be drawn on whether a vote against the deal in Parliament would mean that Britain could remain a member of the EU -- or a departure without a deal. "If the option is the deal you've negotiated or no deal at all but still leaving then I think that would put huge pressure on Parliament to agree to it.

"But if there were an option to go back in [to the EU] then it's a little bit uncertain."

Single market and customs union

What May said: May was clear on Britain leaving the single market in an effort to pursue what she called a "bold and ambitious free trade agreement." But she said that the UK would attempt to negotiate as much access as possible to it, without having to sign up to obligations on the free movement of people.

May said the UK would try to keep some kind of relationship with the customs union, which allows for the tariff-free movement of goods in the EU, to ensure that cross-border trade is "as frictionless as possible."

What it means: As an EU member, the UK trades freely with the other 27 EU countries. That two-way flow was worth about £513 billion in 2015, just over half the UK's total. A new EU-UK deal will now have to be struck.

But it doesn't end there. The EU manages preferential trade deals with nearly 60 other nations on behalf of its members. The UK will have to seek new ties with those countries.

On May's plan to strike a new customs deal, Tom Raines, a research fellow at the Europe Program at Chatham House, said it would "require some creative thinking to reduce the regulatory burden."

Immigration

What May said: The Prime Minister said she wanted to guarantee the rights of EU citizens already in Britain and British citizens in other EU states "as early as we can." But she was unable to offer any more clarity than that.

Addressing future immigration from European countries, May said: "Brexit must mean control of the number of people who come to Britain from Europe. And that is what we will deliver."

What it means: For EU citizens living in Britain, there was no comfort. The Prime Minister made it clear that their status was up for negotiation, and depended on the rights conferred on British citizens living in the European Union.

"The issue has been that the EU has had the mantra of no negotiating before Article 50 is triggered which led to a stalemate.

"The government has said that it will be dealing with this straight away. It understands the individuals concerned want to know what is happening as well as the business community, who want to know about their workplace."

Maintaining the unity of the UK

What May said: The Prime Minister said she would put preservation of "our precious union" at the heart of the negotiation with Europe -- a reference to the constituent parts of the United Kingdom. Scotland and Northern Ireland voted overwhelmingly to stay in the EU.

May said she would seek input on the deal from the UK nations and regions. "We won't agree on everything, but I look forward to working with the administrations in Scotland, Wales and Northern Ireland to deliver a Brexit that works for the whole of the United Kingdom," May said.

Scottish First Minister Nicola Sturgeon wants to keep Scotland in the EU single market.

What it means: Scotland's First Minister, Nicola Sturgeon has made little secret of her desire to launch a second independence referendum should May seek to leave the single market.

Sturgeon issued a stout response on Tuesday. "Scotland did not vote for the direction set out in the Prime Minister's speech today -- and it is not in our national interests," she said.

It seems likely that May is heading for a showdown with the Scottish government. But Peel said the Scottish First Minister was on the back foot. "She's been told today, 'get lost, we're not staying in the single market," he said.

The collapse of the power-sharing agreement in Northern Ireland last week raises an added complication for May, should Brexit become an issue in the elections that have been called for March.

Land border with European Union

What May said: Under the terms of the 1998 Good Friday Agreement that ended sectarian conflict in Northern Ireland, there is currently an open border between the UK and the Republic of Ireland. But critics have questioned whether an open border can be maintained after Britain leaves the EU, with Ireland staying in.

May said bringing about a solution would be an "important priority" adding that "nobody wants to return to the borders of the past, so we will make it a priority to deliver a practical solution as soon as we can."

What it means: "The Achilles heel of the entire negotiation process is Ireland and Northern Ireland," Peel told CNN.

"It's a huge question as to whether some sort of border will have to be reinserted there. It is fundamental to the peace agreement that the population of Northern Ireland has the right to have Irish citizenship as well as British citizenship.

"Can that be maintained? I think it will be, but will the other members of the EU accept a situation where you have a land border of the EU with a non-member state that is open?"