Washington (CNN) The Supreme Court said Tuesday that the parents of a Mexican youth who was shot to death in Mexico by a US Border Patrol agent standing on American soil cannot try to sue the agent in US courts for damages.

The ruling is a win for the agent and the United States government, who argued the case should not be allowed to go forward. The decision will make it harder for individuals to sue federal officers when their constitutional rights are violated.

Justice Samuel Alito, writing for the majority, said that "regulating the conduct of agents at the border unquestionably has national security implications" and that any risk of undermining border security provides a "reason to hesitate."

The conservative justice emphasized that the circumstances surrounding the case were "tragic," but said Congress needs to act, rather than the courts.

Read More