The House of Commons backed the move “as a contribution to securing a negotiated two-state solution” – although less than half of MPs took part in the vote.
The result, 274 to 12, is symbolic but could have international implications.
Government ministers abstained on the vote, on a motion put forward by Labour MP Grahame Morris and amended by former Foreign Secretary Jack Straw.
Middle East Minister Tobias Ellwood said Britain reserved the right to recognise Palestine when it is “appropriate for the peace process”.
In 2012 the UN General Assembly voted to upgrade the Palestinians’ status to that of “non-member observer state”.
The assembly voted 138 to nine in favour, with 41 nations – including the UK – abstaining.
Mr Morris told MPs recognising Palestine as a state would be a “symbolically important” step towards peace, saying relations between Israelis and Palestinians were “stuck at an impasse”.
Current UK government policy, as set out by former Foreign Secretary William Hague, is that it “reserves the right to recognise a Palestinian state bilaterally at the moment of our choosing and when it can best help bring about peace”.
The full motion stated: “That this House believes that the Government should recognise the state of Palestine alongside the state of Israel as a contribution to securing a negotiated two state solution.”
Explaining Labour’s support, shadow foreign minister Ian Lucas said it would “strengthen the moderate voices among the Palestinians who want to pursue the path of politics, not the path of violence”.
“This is not an alternative to negotiations, it is a bridge for beginning them,” he said.
Conservative Nicholas Soames said: “I’m convinced that to recognise Palestine is both morally right and is in our national interest.”
Another former foreign secretary, the Conservative Sir Malcolm Rifkind, said he too wanted to see a two-state solution but added: “Symbolism sometimes has a purpose, it sometimes has a role, but I have to say you do not recognise a state which has not yet got the fundamental ingredients that a state requires if it’s going to carry out its international functions and therefore, at the very least, I would respectfully suggest this motion is premature.”
Labour MP Graham Morris says recognising the state of Palestine is the “right thing to do” ahead of a vote in the Commons
The government is not bound to do anything as a result of the vote.
Mr Ellwood said: “Only an end to the occupation will ensure that Palestinian statehood becomes a reality on the ground. The UK will bilaterally recognise a Palestinian state when we judge that it can best help bring about the peace.”
Ahead of the debate, the prime minister’s official spokesman said: “The government’s position is very clear and hasn’t changed, so I think that is a very clear indication of the British government’s approach.
“The government’s approach is a long-standing one and is in support of a two-state solution and we will continue to work with a range of international partners – Israel, the Palestinian Authority – in support of that.”
Although Liberal Democrat ministers were expected to abstain, in accordance with established policy on backbench debates, it is party policy to support recognition of Palestinian statehood.
The vote comes amid moves elsewhere in Europe to recognise Palestinian statehood officially, more than 100 countries having done so.
Israel says moves to recognise Palestine are premature and undermine efforts to reach a peace settlement between the two sides.
Palestinian officials say they have been forced to pursue measures including seeking greater recognition internationally because a succession of peace talks has failed.
Labour has twice called on the government – in 2011 and 2012 – to back Palestine’s request for official state recognition at the UN.