Two brothers, one a former New York City police officer and the other a federal customs officer, were sentenced on Friday to three years in prison for illegally exporting military-grade weapons to the Philippines for more than four years.

Judge Allyne R. Ross of Federal District Court in Brooklyn, in handing down the sentences, said she wanted to “give the public confidence that the rule of law applies with equal force to law enforcement officials and non-law enforcement officials.”

One of the brothers, Rex Maralit of Lawrenceville, N.J., 46, was a member of the New York Police Department for 11 years. The other, Wilfredo Maralit of Garden Grove, Calif., 49, served as a Customs and Border Protection officer for nine years.

From January 2009 to September 2013, the two bought and sent to the Philippines a variety of weapons, including assault rifles, AR-15s and semiautomatic weapons designed to penetrate body armor. A license issued by the State Department is required to sell such weapons overseas, and the brothers did not obtain one. They pleaded guilty in June to violating an export law.