State Sen. Jim Whelan, a former Atlantic City mayor and Democrat who represents one of the most competitive districts in New Jersey, said Wednesday he would not seek reelection in November.

"I have had a great run in politics, but as with everything else in life, there comes a time and for me, that time is now," Whelan said in a statement. "I will not be a candidate for the New Jersey Senate in 2017."

Whelan, 68, has served in the Senate since 2008 and is a member of a formidable bloc of South Jersey Democrats that has worked aggressively to advance its interests in Trenton. He represents the Second Legislative District, which spans parts of Atlantic County.

His retirement is likely to set off a fierce general-election fight for the seat. Possible contenders include the two assemblymen who represent the Second District: Democrat Vince Mazzeo and Republican Chris A. Brown.

In 2015, when Mazzeo and Brown were up for reelection in the Assembly, the candidates, their running mates, and outside groups spent nearly $5 million on the campaign for the district's two seats, according to an analysis by the Election Law Enforcement Commission.

That was the most expensive race in any single district in 2015 and the second most expensive Assembly campaign in New Jersey history, according to election regulators.

This year's Senate race in the Second District is also likely to be costly, in part because redistricting has rendered it one of the few swing districts in the state.

Moreover, Senate President Stephen Sweeney of Gloucester County could use the support of a fellow South Jersey Democrat in order to win reelection to his leadership position. (Sweeney is also up for reelection.)

Cognizant of both those facts, Republicans are also likely to target the race.

Sweeney's allies worked hard to reelect Mazzeo in 2015 and, unsuccessfully, to elect his Democratic running mate, Colin Bell.

General Majority PAC, an outside group with ties to Sweeney's chief political benefactor, George E. Norcross III, slammed Brown and his running mate in TV ads in 2015.

The political action committee received $25,000 that year from another independent group that supports Sweeney.

All 120 seats in the Democratic-controlled Legislature are up for election in November.