Microsoft agreed to pay $25 million to settle U.S. government investigations into alleged bribery by former employees in Hungary.

The software maker’s Hungarian subsidiary entered into a nonprosecution agreement with the Department of Justice and a cease-and-desist order with the Securities and Exchange Commission, Microsoft said in an email to employees from Chief Legal Officer Brad Smith posted Monday on the company’s website. The case concerned violations of the Foreign Corrupt Practices Act, according to an SEC filing.

The Justice Department concluded that between 2013 and June 2015 “a senior executive and some other employees at Microsoft Hungary participated in a scheme to inflate margins in the Microsoft sales channel, which were used to fund improper payments under the FCPA,” Smith wrote in the email.

Microsoft sold software to partners at a discount and the partners then resold the products to the Hungarian government at a higher price. The difference went to fund kickbacks to government officials, The Wall Street Journal reported in 2018. The company fired the employees involved, Smith noted.

To find and prevent such illegal activities, Microsoft now requires discounts it provides to sales partners to be passed directly to government customers. The company makes customers aware of any discounts to ensure they are receiving them and that funds are not diverted for other purposes like bribes. The company also is using machine-learning software to track contracts and flag discounts or other practices that appear unusual.