Kuwait's parliament has passed a bill to grant citizenship to up to 4,000 "foreigners", which MPs hope will help solve the problem of stateless people.
All but two MPs voted in favour of the law, which must be signed by the emir.
The legislation was amended to say "4,000 foreigners" rather than "4,000 stateless people", known locally as "Bidun", amid pressure from ministers.
There are some 106,000 Bidun who claim Kuwaiti nationality but are considered illegal residents by the government.
Between 10,000 and 100,000 Bidun also live in the United Arab Emirates.
Kuwait's Bidun population originates from those whose ancestors failed to apply for nationality or lacked necessary documentation at the time of independence in 1961; those recruited to work in the security forces during the 1960s who settled in Kuwait along with their families; and children of Kuwaiti mothers and stateless or foreign fathers.
During the 1960s and 70s, the Bidun received the same economic and social benefits received by Kuwaiti citizens, although they could not vote.
However, the government's policy towards them changed during the 1980s and 90s amid regional political instability. Their status was downgraded to that of "illegal residents", which led to a loss of benefits and exclusion from government services and jobs.
Since then, Bidun have faced severe obstacles in many areas such as access to healthcare and education, and many live in poverty.
In the past two years, they have organised large demonstrations to protest against their situation and demand basic rights. Security forces have frequently responded by firing tear gas to disperse the protesters or arresting them.
On Wednesday, the State Minister for Cabinet Affairs, Sheikh Mohammed Abdullah al-Sabah, said the government hoped that the new law would be the "foundation for resolving the Bidun problem".
However, officials have said only 34,000 of the Bidun in Kuwait qualify for consideration, while the rest hold other nationalities.
They allege that some Bidun, or their ancestors, destroyed their original passports so that they could claim the right to Kuwaiti citizenship.