The decision allows the Defense Department money to be spent now while a court battle plays out over whether the government had the authority to divert funds that were not appropriated for the wall. The Supreme Court voted 5-4, along ideological lines, to allow the funds to be used while the court appeals proceed.

In a brief order, the court said that it was ruling in favor of the Trump administration before the litigation has played out because the government had made a "sufficient showing" that the challengers did not have the legal right to bring the case.

Three members of the liberal wing of the court -- Justices Ruth Bader Ginsburg, Sonia Sotomayor and Elena Kagan -- wrote they would have blocked the funds for now. The fourth member, Justice Stephen Breyer, wrote separately to say that he would have allowed the government to use the funds to finalize the terms for contractors but block the funds from being used for the actual construction.

The Supreme Court's order is a significant win for Trump, who is likely to use the construction of a wall as a major talking point on the campaign trail. The President celebrated the decision in a tweet Friday evening.

Read More