LONDON—British Prime Minister Theresa May secured cabinet approval for her Brexit deal Wednesday evening, clearing an important hurdle but setting the stage for a battle in Parliament that could shake her government and unravel the agreement with the European Union for Britain’s orderly withdrawal.

Following a five-hour meeting, Mrs. May’s ministers gave the green light to a plan that would keep the U.K. bound to the EU for many years after the country formally leaves the bloc in March. The prime minister appeared to avoid...