– The Supreme Court has freed states to control what appears on their specialty license plates, ruling Thursday that Texas authorities were justified in refusing to issue a plate bearing a Confederate battle flag.

In a 5-4 decision, the justices said a state-issued license plate is “government speech,” not the private speech of a motorist. For that reason, the state may decide which messages it wants conveyed on license plates.

“When the government speaks, it is not barred by the free speech clause from determining what it says,” Justice Stephen Breyer said for the court.

Justice Clarence Thomas cast a rare vote with the court’s four liberals to form the majority.

The decision reverses rulings from several lower courts which had said that since states had allowed private groups and charities to sponsor specialty plates, the state could not censor some of them based on their message.

In the Texas case, the Sons of Confederate Veterans applied to sponsor a specialty plate that displayed a Confederate battle flag. When a state board refused to issue the plate, the group sued and won in the lower courts based on the claim that the state’s decision violated the First Amendment.

Justices Ruth Bader Ginsburg, Sonia Sotomayor and Elena Kagan joined Breyer and Thomas in ruling for Texas in the case.

Justice Samuel Alito spoke for the dissenters and said motorists on the highway would know that specialty plates represent the “private speech” of the car owner, not the government. “The state of Texas has converted its specialty plates into little mobile billboards on which motorists can display their own messages,” he said. It is “blatant viewpoint discrimination” for officials to reject one group’s message as “offensive,” he said. Chief Justice John Roberts and Justices Antonin Scalia and Anthony Kennedy joined his dissent.

It is not clear what the decision will mean for abortion-related disputes over the “Choose Life” license plates. Some abortion rights groups have argued that the state with such specialty plates must also issue a plate with a message such as “Respect Choice.” That issue was raised in a North Carolina case that is still pending on appeal.