THE MAYOR of Medford, N.J., accused on a website two months ago of having sex with a male prostitute at a California hotel, resigned yesterday.

The anonymous allegation against Republican Chris Myers, married and a father of two, included a photo of a man who appeared to be him in his underwear.

The person making the allegation claimed to be a prostitute. He contended that Myers had contacted him through a male-escort website and that they had met at a Newport Beach, Calif., hotel. He said that Myers had paid him $500 but that he hadn't fulfilled promises of a car and other gifts. He said on the website that the broken promise was the reason he was taking his story public.

The website was taken down soon after becoming public.

Myers, in an interview with a reporter for South Jersey Courier-Post in October, refused to comment on the allegations but didn't deny them. At a November township council meeting, Myers denied the claims, calling the Internet "a murky, anonymous place."

His resignation letter submitted to town officials yesterday did not mention the scandal.

"My work commitments will not allow me to devote the time that is needed in the months ahead," Myers wrote.

Some other council members have complained that the allegations against Myers have gotten in the way of the business of the Burlington County town of 23,000 residents. After the allegations surfaced. Myers missed one township council meeting and postponed another.

He won the GOP nomination for a congressional seat in 2008 but lost the general election. He has been suspended as a vice president at technology manufacturer Lockheed Martin Corp.