The mayor of Rahway stepped down Sunday after a tumultuous 16 months that saw him twice crash a city car, take a seven-week medical leave to resolve then-unspecified personal issues and later publicly reveal that he is bipolar.

In an email to the city clerk, the business administrator and an attorney who has represented the city, Samson Steinman said his resignation was effective immediately.

"At the present time, I can not give the position the effort it requires and the effort the citizens deserve," he wrote in the email, obtained by NJ Advance Media. "It was an honor and a privilege to serve the the city Rahway (sic)."

Steinman, 46, said by phone Sunday that he had realized he needed to focus on himself.

"I think everybody knows I've been working on resolving some issues, and I can't give the time required for the position," he said.

He said council President Raymond Giaccobe Jr. would serve as Rahway's mayor until the city Democratic committee presents the names of three candidates to the council. The council will choose one of those candidates to finish Steinman's term, which runs through 2018.

"Rahway is a resilient community that will pull together in difficult times," Giacobbe said in a text message. "We are a people with strong spirit that will do what is right. I wish Mayor Steinman well in the future and I am prepared to accept the responsibility of running the Rahway City government to keep our great community moving forward."

Steinman's resignation comes seven months after he told the public he had been diagnosed with bipolar disorder a year earlier and had sought in-patient treatment during his medical leave in March and April. At the time, he said he was unsure whether his insomnia, a side effect of his bipolar disorder, had caused either of his two car crashes.

He said in a May 4 interview that he planned to continue to serve as mayor.

"I've always felt like an outsider. I've always felt different, alone, discontent," said Steinman, a Democrat. "There's not one thing in life that I enjoy or makes me happy, except being mayor."

Steinman came under public scrutiny after he hit a parked car around 5:30 a.m. on Aug. 26, 2016. He told a Rahway police officer who responded to the crash that he had been driving on Central Avenue near Pierpont Street and swerved to avoid hitting an animal that ran into the road.

He was charged with driving with an expired license.

Steinman hit another parked car at about 9:30 p.m. on March 18. He told police he had struck the car on Kline Place after "a pothole, divot or ice patch" made him lose control of his vehicle.

He was charged with careless driving and failing to show his insurance card when he could not find it after the collision.

Officers administered several drug and alcohol tests to Steinman after the March crash, according to body camera footage. Although he made mistakes in parts of two tests, the officers determined he was not intoxicated.

Steinman then announced he would go on medical leave to "address a series of personal issues that began during childhood."

Rahway's council on April 24 unanimously approved a resolution requiring city employees to take a defensive driving class if they get into a crash with a city car. City officials declined to say whether the policy was related to Steinman's crashes.

Marisa Iati may be reached at miati@njadvancemedia.com. Follow her on Twitter @Marisa_Iati or on Facebook here. Find NJ.com on Facebook.

Have a tip? Tell us. nj.com/tips