Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Texas man who recorded himself licking ice cream at a Port Arthur Walmart and returning the carton to the store freezer was sentenced to 30 days in jail on Thursday.

D'Adrien Anderson, 24, was also sentenced to two years' probation for the Blue Bell stunt, which occurred amid a viral trend of ice cream licking at stores, NBC affiliate KJAC of Beaumont reported.

A man licks ice cream from a Blue Bell carton at a Walmart in Port Arthur, Texas. via Facebook

He is also required to pay a fine of $1,000 and restitution of $1,565 to Blue Bell Creameries, the Jefferson County District Attorney’s Office said in a statement.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The video was posted online in August, and in January, Anderson pleaded guilty to criminal mischief.

Anderson told police he licked the ice cream as a prank and later went back and bought the carton.

Anderson did buy the carton, police have said, but the Walmart replaced its entire inventory of ice cream.

Jefferson County officials were not impressed by the prank.

"Anderson's actions caused public concerns about the safety and quality of consumer products offered for public consumption, impacted Blue Bell consumer confidence and caused the company financial loss. This type of activity will not be tolerated," the Jefferson County District Attorney’s Office said.

The office said any similar case will be taken seriously and charges will be filed.

Blue Bell is a beloved Texas-based ice cream company.

Amid the viral Blue Bell-licking trend, Texas Gov. Greg Abbott hailed police for tracking down another teen who did the stunt and warned "Don't Mess With Texas... or with Blue Bell."

Port Arthur is a city of around 55,000 south of Beaumont, near the Louisiana border.