The government's fiscal charter has passed with 320 votes in favour and 258 votes against, a majority of 62.
Some 21 Labour MPs defied shadow chancellor John McDonnell and leader Jeremy Corbyn by abstaining.
On Monday McDonnell sparked outrage among Labour MPs when he announced his party would reject the government's fiscal charter less than one month after saying he planned to support it.
In the debate that preceded the vote McDonnell admitted his U-turn was embarrassing and that he was trying to "out-Osborne Osborne", but said "when circumstances change, you should change your stance".
He went on to say that the charter is a "puerile political trap", whereby an MP voting against it is a deficit denier, and said that voting for it is to back all cuts.
Speaking before McDonnell, chancellor George Osborne said the people who oppose this charter "never want a surplus. They want to run a deficit forever, they never want Britain to be earning more than it spends". Osborne added:
The truth is they want to borrow forever. They want to run a deficit forever. They believe our debts should rise and rise, not ever come down. And they just don’t have the courage to admit it to the British people.
The truth is running a deficit forever is not socialist compassion it is economic cruelty and Britain wants no more of it.
The charter for budget responsibility, which was first introduced in parliament over the summer, will require the government to balance its books by 2019. From then on, all governments will have to run an overall budget surplus unless the country veers from “normal” conditions.