The countries are all under economic and trade sanctions by the U.S. government.
Barclays and the Justice Department entered into a deferred prosecution agreement that will delay any criminal proceedings for two years while Barclays demonstrates to federal prosecutors that it is complying with U.S. laws.
The bank was accused of violating the Trading with the Enemy Act and the International Emergency Economic Powers Act.
The bank will pay $149 million to the United States and an additional $149 million under an agreement with the Manhattan district attorney's office in New York.
According to the court papers, Barclays concealed the transactions that it carried out with banks in the sanctioned countries from 1995 to 2006.
The bank violated U.S. and New York state criminal laws by allowing the movement of hundreds of millions of dollars through the U.S. financial system on behalf of banks from Cuba, Iran, Libya, Sudan, and Burma, the court papers in the case stated.
The U.S. government and Barclays will present their proposed agreement to a federal judge for recommended approval.