MPs voted by 432 votes to 202 to reject the deal, which sets out the terms of Britain's exit from the EU on 29 March.
Labour leader Jeremy Corbyn has now tabled a vote of no confidence in the government, which could trigger a general election.
The confidence vote is expected to be held at about 1900 GMT on Wednesday.
The defeat is a huge blow for Mrs May, who has spent more than two years hammering out a deal with the EU.
The plan was aimed at bringing about an orderly departure from the EU on 29 March, and setting up a 21-month transition period to negotiate a free trade deal.
The vote was originally due to take place in December, but Mrs May delayed it to try and win the support of more MPs.
The UK is still on course to leave on 29 March but the defeat throws the manner of that departure - and the timing of it - into further doubt.
MPs who want either a further referendum, a softer version of the Brexit proposed by Mrs May, to stop Brexit altogether or to leave without a deal, will ramp up their efforts to get what they want, as a weakened PM offered to listen to their arguments.