ATLANTIC CITY — A former city official on Monday admitted he had marijuana in the city vehicle he was driving in October 2011.

Mark Hamilton, 57 - a city resident - pleaded guilty to possession of less than 50 grams of marijuana.

Hamilton was Superintendent of Atlantic City’s Office of Weights and Measures when he was pulled over by police on Oct. 13, 2011 on Route 40. Police found the pot in the car at that time.

Under a plea agreement, Hamilton will receive a conditional discharge so long as he remains drug-free for six months, authorities said.

He’ll also be subject to random drug screenings and will have to pay a $750 fine. Hamilton must forfeit his public employment by the city, said First Assistant Atlantic County Prosecutor Diane Ruberton, who represented the state in the case.