FRANKFORT, Ky. — A federal court is allowing a Kentucky man to personalize a license plate with the phrase "IM GOD” after a three-year legal battle over the custom engraving.

Court documents show Ben Hart, a self-identified atheist, set out to get the Kentucky plate in 2016. But Hart's request was denied by the state transportation department on the basis it violated antidiscrimination guidelines. News outlets report similar plates had been approved before, including "TRYGOD" and "NOGOD."

Kentucky’s American Civil Liberties Union and the Freedom From Religion Foundation got involved to help Hart challenge the decision. In an opinion Wednesday by a U.S. District Court in Frankfort, the judge ruled “vanity plates” are private speech protected by the First Amendment and that the state had violated Hart’s rights by denying him the plate.

RELATED: A lot of people were Googling 'Ron Reagan' after his atheism ad aired

RELATED: 'In No God We Trust' banners stirring up controversy in Fort Worth

An image of Hart released by the Freedom From Religion Foundation showed Hart with a similar plate he had from Ohio when he was living there. In addition to reading "IM GOD," the bottom of the plate read "One Nation Under God."

ben hart im god_1479844231335-23792536.JPG
“IM GOD” license plate denied to Kentucky man, Ben Hart (photo: Freedom From Religion Foundation)

If the Freedom From Religion Foundation sounds familiar, you may recognize it from the ads starring Ron Reagan, son of late President Ronald Reagan. The self-described atheist expresses concern over religion playing a role in government. He ends the ad saying he's "not afraid of burning in Hell." A lot of people were Googling Reagan's name when the ad appeared during the October Democratic presidential debate.