New Jersey State Senator Jim Whelan (D. Atlantic County) was hospitalized Wednesday to undergo a procedure to treat an irregular heartbeat.

Whelan, 66, the former mayor of Atlantic City, release this statement on Facebook Wednesday.

"Today, I underwent a procedure called a cardioversion to get my heart rate back in rhythm. While I am happy to report that the procedure was a success, my doctors would like to keep me under observation at Shore Medical Center for the next couple of days. My sincere thanks to the staff at Shore and everyone who wished me a speedy recovery."

Whelan said he had a similar procedure recently, but doctors weren't happy with its results.

"It only worked for a day and a half, then my heart fell back out of rhythm again", he said.

He is expected to be kept under observation at Shore Medical Center in Somers Point for two or three days.

Whelan served as an Atlantic City Councilman from 1982 to 1990, and as Mayor from 1990 to 2001. He has been in the  New Jersey Senate since 2008.

Whelan attended Temple University, where he became a nationally-ranked distance swimmer. He was inducted in the Temple University Athletic Hall of Fame in 1995.

After graduating college, Whelan taught swimming at an Atlantic City elementary school and he spent summers working as an ocean lifeguard. He has taught in Atlantic City schools for more than 20 years.