A Virginia appeals court on Tuesday upheld the conviction of a man who was arrested after he hung a life-size black doll by a noose in his front yard the day of the Charleston, S.C., church shootings last year.

The Virginia Court of Appeals, the state’s second-highest court, found that a state law that bans displaying a noose with the intent to intimidate is constitutional.

On June 17, 2015 — the same day authorities say Dylann Roof killed nine people during a prayer meeting at a historic African American church in Charleston — a woman driving in Franklin County, Va., saw the “all-black, life-size dummy hanging by a noose from a tree” in the front yard of Jack Eugene Turner, the Virginia attorney general’s office said in a statement.

Turner, who lives next to a black family, was convicted in Franklin County Circuit Court of violating Virginia’s ban on displaying a noose, the statement said, but he appealed the conviction, challenging the constitutionality of the law and whether the display occurred in “a public place.”

On Tuesday, the appeals court rejected Turner’s argument that he had a First Amendment right to display the noose, concluding that the noose “constitutes a ‘true threat,’ and, like cross burning, it is undeserving of First Amendment protection.”

The court also said that under the law, Turner’s yard qualified as a “public place.”

“The use of an intimidating and threatening display on one’s own premises constituted a violation of the law because Turner displayed a noose and dummy in a place and manner to communicate threats to others with the intent to place members of the public in fear of violence and bodily harm,” s aid the opinion, written by Judge Robert J. Humphreys.

The court noted that more than 2,400 black people died by lynching between 1880 and 1930, and that Turner “placed a handmade cardboard sign against his house that read, ‘Black n----- lives don’t matter, got rope’ ” while awaiting sentencing.

Virginia’s attorney general praised the decision.

“The Commonwealth will not tolerate expressions of hate, intolerance, or bigotry intended to intimidate people because of their race,” Attorney General Mark R. Herring (D) said in a statement. “The display of a noose as a threat has rightly been banned in Virginia because it is an unmistakable signal that evokes the horrific and shameful specter of lynching.”

Turner was sentenced to five years, with four years and six months suspended. His attorney said he has served his sentence and plans to appeal to the state Supreme Court.

“We’re looking forward to appealing this, and we believe it is a First Amendment case,” C. Holland Perdue III said.