A man on a stolen dirtbike led officers on a chase Tuesday afternoon and changed clothes in an effort to evade them, according to Costa Mesa police.

A suspect, Joseph Hopkins, 29, of Costa Mesa, was arrested on suspicion of burglary, attempted burglary and possession of a stolen vehicle, police said.

A Costa Mesa police officer saw a man riding an off-road motorbike without a helmet just before 1 p.m. at Newport Boulevard and Bay Street. The officer turned on his lights, but the man continued while committing other vehicle code violations, said Costa Mesa police Sgt. Dan Miles.

The officer followed the man as he traveled north on Thurin Street and turned onto Victoria Street. The man eventually stopped at an apartment complex in the 300 block of Victoria, ditched the dirtbike and fled, Miles said.

The man began jumping fences and running through backyards before being found wearing different clothing inside a garage.

“Once the subject was cornered in a garage by a barking K-9 [police dog], he surrendered,” Miles said.

Miles said the motorbike was one of three stolen in a commercial burglary in the city.

hannah.fry@latimes.com

Twitter: @HannahFryTCN