James Solomon has been elected the next mayor of Jersey City.

The former teacher and eight-year Democratic city councilmember beat out former New Jersey Gov. Jim McGreevey in a runoff election Tuesday night. The Associated Press called the race for Solomon only 40 minutes after polls closed and with only 20 percent of the votes counted.

Together, we’re going to build a more affordable Jersey City, where everyone has a chance to thrive and where the people are put first, not developers and special interests," Solomon said in a victory statement. "My promise to Jersey City is simple: I will be a mayor for you."

Like many electoral contests around the state and country, the race to become the next mayor of New Jersey’s second-biggest city focused on affordability issues. In the lead-up to Tuesday, Solomon and McGreevey traded barbs over each other’s approaches to rising property taxes, rising rents and other cost-of-living concerns.

During his campaign, Solomon put forth a housing plan that he argued would favor working class and lower- and middle-income families over developers.

He campaigned on a platform that included mandatory 20% set-asides for income restricted housing in all new developments, along with limits on sweetheart tax abatements for developers. Solomon said he would require some units to be as cheap as $1000 a month.

In the weeks between the November election and Tuesday’s runoff, McGreevey repeatedly attacked Solomon over the $1,000 rental rate apartment scheme, calling it “fantasy-thinking.”

McGreevey’s own affordable housing plan was short on details, though he did say he wanted to carve out 20 percent of all new development for affordable housing.

Solomon appears to be entering office with a lot of allies on the 9-person City Council. Two of his slate won the general election in November and another 3 were trending ahead Tuesday night.

Other leading council candidates that ran against the Solomon slate in November joined forces for the December runoff: Joel Brooks in Ward B and Jake Ephros in Ward D, both of whom were backed by the Democratic Socialists of America, appeared headed to victory when the numbers are finalized. Candidate Tom Zuppa was on track Tuesday night to topple longtime Jersey City Councilman Richard Boggiano.

Last month, Democrat Mikie Sherrill handedly defeated Republican Jack Ciattarelli by 15 points in the governor’s race.

New Jersey residents and politics watchers will only get a short reprieve from elections. In less than 70 days, the primaries will be held in the state’s 11th district to fill Sherrill’s now-vacant congressional seat.

Solomon will be sworn in as mayor on Jan. 1.

This story has been updated with additional information.