Smith & Wesson has found itself on the wrong side of the law while trying to sell guns to police officials overseas.

The Massachusetts-based company has agreed to pay the U.S. government $2 million for bribing officials in Pakistan, Indonesia and other countries as it tried to sell firearms to military and law enforcement agencies.

The Securities and Exchange Commission says the violations took place between 2007 and 2010. The agency says Smith & Wesson has also agreed to fire its international sales staff.

Related: Americans are buying fewer guns

In one case, the SEC says Smith & Wesson provided more than $11,000 worth of guns as a gift to Pakistani police officials there. That deal won the gun maker a contract to sell 548 pistols to the police department for a profit of $107,852.

While that was the only corrupt contract ultimately fulfilled, the SEC says the company also tried to secure sales contracts by bribing officials at an Indonesian police department, as well as foreign officials in Turkey, Nepal and Bangladesh.

Smith & Wesson CEO James Debney said in a statement that the company agreed to the settlement without admitting or denying the agency's findings.

In addition to the $2 million payment, the company has implemented new procedures concerning its overseas business practices. It will report back to the SEC on its compliance efforts for the next two years.

While the industry has seen a run-up in demand in recent years from Americans fearful of stricter gun restrictions, that trend may be slowing. Smith & Wesson (SWHC) reported a drop in sales during its most recent quarter and lowered its forecast.