The judge contended that since the National Security Council does not have the legal right to send police outside of Kenya, the deployment would be unlawful.
The only peacekeeping missions for which the council can send armed forces are those in Haiti, he continued.
Kenya had offered to take charge of an international security force in Haiti last year in an effort to stop gang violence.
Ariel Henry, the prime minister of Haiti, requested last year that a multinational force be sent out immediately.
He claimed that gangs in control of 80% of the capital, Port-au-Prince, had overthrown his government.
Kenya’s offer to lead the force was supported by the UN Security Council, and the deployment was subsequently approved by Kenyan lawmakers.
The opposition leader who initiated the case, Ekuru Aukot, declared that Kenya had won and that the nation could not afford to spare officers before addressing its own security issues.
President William Ruto, Mr. Aukot continued, was merely using the deployment to maintain his international standing and curry favor with Western nations like the US.
According to President Ruto, Kenya has a “impressive record” of taking part in international peacekeeping operations.
He went on to say that the deployment would help the officers hone their security-related abilities and experience.
An anonymous police source told the BBC that they had already undergone two months of rigorous training before the decision.
He went on to say that the courses covered a variety of topics, including how to handle weapons, international law, and Haitian topography.