Among the signatories were EU countries but also previously staunch proponents of banking secrecy such as Liechtenstein and tax havens like the Cayman Islands.
The deal - known as the Multilateral Competent Authority Agreement - crowned two days of talks by the Global Forum on Transparency and Exchange of Information for Tax Purposes. The meeting was hosted by German Finance Minister Wolfgang Schäuble.
Fifty-one countries signed one agreement to put in place an automatic exchange of information between the participating countries beginning in September 2017.
The agreement designates the national authority in each country which will be responsible for collating the data and transferring it to the other countries.
The aim is for every country to be kept fully informed about the offshore holdings of its citizens.
Around 30 other countries - including Austria and Switzerland, the Bahamas and the United Arab Emirates - pledged to join the agreement from 2018.
"Banking secrecy, in its old form, is obsolete," Schäuble told the mass-circulation daily Bild in an interview.
The danger of being caught is now "very high", Schaeuble said.
The forum was set up under the auspices of the Organisation for Economic Cooperation and Development (OECD
), which said that "offshore tax
evasion is a serious problem for jurisdictions all over the world."
Economist Gabriel Zucman, a specialist in fiscal fraud, has calculated that about €5.8 trillion ($7.4 trillion) is stashed away in tax havens, depriving authorities all over the world of around 130 billion euros in revenue each year.
Banking secrecy lives on
But experts in fiscal fraud, such as Andres Knobel of Tax Justice Network, has identified a number of potential shortcomings in the OECD deal.
In order to exchange information in 2017, the banks will collect the data from 2016 on accounts holding more than $250,000. The delay will be sufficient for tax evaders to carve up their assets and place them into multiple accounts holding smaller amounts.
Countries will also be able to decide on a case-by-case basis which information will be automatically exchanged.
Switzerland, for example, has said it will hand over information only to countries which are important for Swiss industry. Thus, the holdings of wealthy citizens from poor countries will not come under scrutiny.
Tax evaders could also hide behind "smoke-screen" companies or foundations in certain cases where banks are not obliged to reveal the identity of the account holder.
That will not help the fight against international money-laundering, the critics complain.