In the last few years, dozens of universities and churches have divested from fossil fuels. The Rockefellers Brothers Fund and the pension fund for public employees in California divested. New York City, Oslo, and other cities divested. Norway’s massive sovereign wealth fund sold off investments in some coal companies and is considering doing the same for oil and gas companies. Now the first country will join the list of nearly 900 institutions that are divesting: Ireland will pull its money out of fossil fuels.

Ireland passed a bill in its lower house of parliament that will require the country’s national investment fund to sell all of its investments in oil, coal, gas, and peat as soon as possible, likely within five years. The bill is expected to quickly pass in the upper house of parliament and could become law this year.

The fund currently holds investments worth more than $400 million in 150 fossil fuel companies (companies that get at least 20% of their revenue from fossil fuels). Right now, those investments help support the trillions that coal, oil, and gas companies are spending to develop new mines, oil fields, and other infrastructure–but studies have calculated that none of those resources can actually be used if the world is going to limit warming to 2 degrees Celsius. Even burning all existing fossil fuel reserves would break the carbon budget.

Investors increasingly see keeping money in fossil fuels as a risk, and public pressure is also helping lead to divestment. In Ireland, the bill came after campaigning from student groups and other activists, and was brought forward by the politician Thomas Pringle after two years of work with those groups, the Catholic development agency Trócaire, and the Global League Action Network.

The bill makes an exception for investments in Irish fossil fuel companies–but only if the money helps finance their move away from fossil fuels.