Israel's parliament has failed to pass an extension to a controversial law barring Palestinians from the occupied West Bank or Gaza who marry Israelis from being granted citizenship rights.
After a debate that lasted through the night, the vote was tied 59 to 59.
It was the first big defeat for Prime Minister Naftali Bennett's government since it took office last month.
The legislation, which critics say is discriminatory, is now due to expire at the end of Tuesday.
Thousands of Palestinians previously unable to claim citizenship rights may now be able to do so.
Mr Bennett set up the vote on the citizenship law as a vote of confidence in his new ideologically diverse government, which comprises eight left-wing, centrist, right-wing and Arab parties and has a razor-thin majority of one seat in the 120-seat parliament.
He had hoped a compromise tabled on Monday would be accepted. It would have extended the law by six months, rather than a year, and seen about 1,600 Palestinians living in Israel granted residency rights.
But in a tense, late-night session, Mr Bennett's government came up short, with one member of his right-wing nationalist Yamina party among those who voted against an extension. There were also two abstentions from the United Arab List, a party representing Israel's Arab minority that sits in the coalition.
Right-wing opposition politicians who had previously supported the legislation, led by recently ousted long-time Prime Minister Benjamin Netanyahu, voted against the law to embarrass Mr Bennett.
Afterwards, Interior Minister Ayelet Shaked of Yamina described as "madness" the celebrations by Mr Netanyahu's Likud party and Bezalel Smotrich's far-right Religious Zionism alliance.
"The reckless conduct of Likud and Smotrich caused the collapse of the citizenship law and will lead to 15,000 citizenship applications," she tweeted.
Mr Netanyahu had refused to help get the measure passed, insisting on Monday that it was the government's responsibility and not the opposition's.
"You cannot form a government that is based on anti-Zionist forces, and them come to us and tell us to save you from this fracture and failure," he said.
The Citizenship and Entry Law was originally passed in 2003, at the time of the second Palestinian intifada, or uprising, when Palestinian militants were carrying out attacks inside Israel.
The authorities have renewed it every year since, citing security reasons.
However, critics believe it is motivated by the desire to maintain a Jewish majority in Israel.
An Israeli Arab man who attended protest outside parliament on Monday said his family had been confined to a "continuous prison" as a result of the law.
"I am asking for rights that the state owes us... for my wife to have Israeli ID, residency rights and freedom of movement," Ali Meteb told AFP news agency.