It'll soon be illegal to look at your phone while crossing the street in Honolulu.

The city's mayor signed an ordinance on Thursday that bans pedestrians from crossing the street or highway 'while viewing a mobile electronic device.'

Anyone caught by authorities would face a fine up to $35 for a first violation. The fine for a second violation within one year would be as much as $75 and a third violation could lead to a fine up to $99.

Honolulu is the first major U.S. city and county to ban use of mobile devices while walking.

But the measure doesn't just cover cell phones. It also includes other 'mobile electronic equipment' such as video games, pagers, laptops, digital cameras and personal digital assistants, according to the bill's text.

The ban is set to take effect on October 25. In the meantime, the Honolulu Police Department said it plans to focus on education and awareness of the new law before issuing citations, according to Hawaii News Now.

Anyone using devices to contact 911 are exempt, as are emergency responders using devices during the 'scope of their official duties.'

"Sometimes I wish there were laws we did not have to pass, that perhaps common sense would prevail but sometimes we lack common sense," Honolulu mayor Kirk Caldwell told media outlets at the bill signing.