The Bolivian Senate has approved a controversial reform bill proposed by President Evo Morales to redistribute under-used land to rural communities.
Thousands of indigenous people rallied in La Paz to demand reform
A week-long stand-off ended when three opposition senators broke ranks with their conservative parties to vote in favour of the bill.
Thousands of indigenous protesters had marched on La Paz on Tuesday to put pressure on the senate to pass the law.
It could lead to the redistribution of up to 20m hectares of land to the poor.
Big landowners oppose the move, saying it will destroy Bolivian agriculture, and have threatened to use force to defend their property.
'Time for change'
The opposition has accused Mr Morales of manipulating his indigenous supporters to push through the reforms.
The bill, passed by the lower house of congress two weeks ago, had been blocked by a boycott of the senate by conservative groups.
But three opposition senators changed their allegiance following Tuesday's protest rally, giving the president the support of 15 of the senate's 27 seats.
News that the law had finally been approved late in the evening surprised even the president's own supporters camped outside the senate, the BBC's Damian Kahya in La Paz says.
Shortly after signing the bill into law, Mr Morales told a jubilant crowd that it was "not possible to have so much land in so few hands".
"This is the struggle of our ancestors, the struggle for power and territory," he said. "Now, the change is in our hands."
The new law states that only unused or corruptly obtained land will be targeted.
The government argues too much land is owned merely as security on loans or to be re-sold.
A recent survey by the Catholic Church found that just 50,000 families own almost 90% of Bolivia's productive land.
Opponents accuse Mr Morales of trampling on democracy in his desire to advance his reform agenda.
Conservative groups have been holding their own protests over the agrarian reforms and proposed changes to the constitution.
A strike by opposition groups and civic movements is planned for Friday.