A white man in South Carolina has been sentenced to 10 years in prison after he pleaded guilty to trying to hire a hit man to kill his black neighbor, hang him from a tree and leave a burning cross in his yard, prosecutors said.

The man, Brandon Cory Lecroy, 26, of Greenwood, was arrested last year after a confidential source tipped off the authorities that Mr. Lecroy had reached out to an unidentified white supremacist organization seeking help in the murder.

An F.B.I. agent posing as a hit man contacted Mr. Lecroy, who told the agent over the phone, “$500 and he’s a ghost,” according to an arrest warrant affidavit. After giving the agent an initial payment of $100, he was taken into custody.

Mr. Lecroy received the maximum 10-year sentence and three years of court-ordered supervision on Friday after pleading guilty to a murder-for-hire charge, the United States attorney’s office in South Carolina said in a statement.