A Buffalo man has been sentenced to 90 days in jail for repeatedly stalking a Cheektowaga woman over the last several months, according to Cheektowaga police.

Robert S. Banks, 48, of Fisher Street, pleaded guilty to a charge of criminal contempt for violating a court order keeping him from engaging in “any offensive or illegal behavior” toward the 44-year-old victim.

Banks was arrested in December for following the woman and writing her phone number on the bathroom wall of a local shopping center, police said.

While waiting for his court case to be heard, Banks threatened the woman in the lobby of the Cheektowaga courthouse, authorities said.

He was again arrested at that time.

Banks was given the jail sentence by Cheektowaga Town Justice Paul Piotrowski.

Police said a second case involving a different woman charging Banks with similar stalking conduct resulted in a contemplation of dismissal in consideration of Bank’s guilty plea and sentence.