The '90s rap star tweeted on Saturday that an officer approached him in his car and asked "Are you on parole or probation?"
He says that as he handed over his ID, the officer reached inside the car and tried to pull him out.
Dublin police Lt. Herb Walters told the Oakland Tribune that Hammer, who was born Stanley Burrell, was arrested Thursday for investigation of obstructing an officer in the performance of their duties and resisting an officer.
He declined to comment to KTVU about Hammer's version of the arrest.
Hammer tweeted that he wasn't bitter and considered what happened "a teachable moment."