In a stunning reversal of fortune, the candidate that State Bar Association officials had tried to disqualify as an out-of-state interloper is now poised to be its president in just three years.

On Monday, Thomas Prol, of Franklin, won a runoff election for the post of second vice president, defeating Nancy Erika Smith, of Montclair, by a vote of 1,860 to 1,721.

Barring unforeseen future challenges, Prol will ascend the ladder of succession to the top office in 2016-17, becoming the first openly gay president in State Bar history.

Also in the runoff, Christine Amalfe of Gibbons in Newark defeated Christina Vassiliou Harvey, of Lomurro, Davison, Eastman & Munoz in Freehold, for trustee at large, by a vote of 1,729 to 1,706.

Prol’s victory was the endgame of a campaign that he launched after being declared persona non grata by the Bar’s Nominating Committee and that he continued despite adoption of a bylaw aimed at making him ineligible for office.

Prol, who had been elected to the secretary post in 2012, would customarily have received the committee’s endorsement this year for treasurer, the next level up.

But in February, the committee withheld its blessing, saying Prol’s new job as associate general counsel for the New York City Department of Consumer Affairs, which required residence in the city, made him ill-equipped to advocate for lawyers in New Jersey.

Rather than oppose the committee’s choice for treasurer, Robert Hille, Prol took advantage of an unforeseen circumstance. Angela White Dalton, the sitting treasurer and the committee’s choice for second vice president, resigned to accept appointment as a state court judge.

Prol automatically ascended to treasurer and announced he would run for the second-vice-president post.

The committee decided not to endorse a new candidate, leaving the post open for a run by any candidate who amassed sufficient signatures on a petition. Smith joined the campaign, as did Kenneth Vercammen, of Edison.

The sitting bar leadership made clear that Prol was not its preferred candidate. In an April 3 letter on State Bar Association letterhead, President Kevin McCann took Prol to task for posting a photo of the two of them on a website that allegedly suggested an endorsement. McCann admitted it was his idea that Smith be contacted to run for second vice president, saying, “She is a well-schooled trial attorney, who actively practices in the State of New Jersey. She is a New Jersey lawyer, as is Ken Vercammen.”

Prol’s New York job continued to be a lightning rod for opposition. A former bar president, Richard Badolato, instigated a bylaw amendment to require bar officers to practice law primarily in New Jersey. The amendment went on the ballot for the May election.

When the votes for second vice president were counted, Smith received 49 percent, Prol 28 percent and Vercammen 23 percent. Since no candidate topped 50 percent, a runoff was required.

But bar members did pass, by a two-thirds margin, the bylaw amendment requiring officers to practice primarily in New Jersey. That left doubt whether Prol could even participate in the runoff, much less take office if he won.

On May 16, Prol gave up his New York City position, saying he wanted to focus on his practice in New Jersey and job as outside environmental counsel for the Sussex County Municipal Utilities Authority.

That still didn’t placate State Bar officials. The Election Committee demanded proof of Prol’s New Jersey practice. Prol provided his resignation letter, his business registration certificate with the state Department of the Treasury and a year’s worth of bank statements from TD Bank, both showing his law office address as 68 Church Street in Franklin. He also furnished his letter of engage with the Sussex MUA.

On May 31, the Election Committee determined that Prol satisfied the new bylaw and could participate in the runoff, which began June 11.

Prol, 44, ran an aggressive campaign that made extensive use of social media like Facebook, YouTube and Twitter. He also won the endorsement of the 2,200-member Young Lawyers Division.

“I think people recognized the State Bar needs to be open, transparent and inclusive, and I think people saw me as the vehicle for that change,” he said Tuesday after the results were announced.

Smith, 58, did not use social media but had a campaign website that cited her endorsement by 15 former Bar presidents and nine former chairs of the Labor and Employment Section, on which she has sat for more than 25 years.

She did not return a reporter’s call on Tuesday.

Alan Zegas, a Chatham lawyer who served as campaign adviser to Smith, said he was “very much surprised by the results” and disappointed.

“We are now left in a position where there are no female officers of the bar,” he said.

Vercammen, who had thrown his support to Prol in the runoff, said the turning point was Prol’s resignation of the New York job. “Many people said, ‘I’m not going to vote for someone who works in New York,’” he said.

Former State Bar president Saul Wolfe (1988-89), who endorsed Prol in a letter sent to all association members, agreed the out-of-state job was a distraction that, once removed, left an even playing field on which Prol could tout his extensive record of bar service.

Prol is a founder and past chairman of the Gay, Lesbian, Bisexual and Transgender Rights Section. He has also been chairman of the Bar’s Finance and Operations Committee; vice chairman of the Amicus Committee; Bar representative to the Supreme Court’s Board of Mandatory Continuing Legal Education; and a member of the Legislative Committee as well as the Membership and Public Relations Committee, among other roles.

“He won because when people stopped to think about it, they realized he deserves to be the second vice president of the association by the virtue of his years of service,” said Wolfe, of Livingston’s Skoloff & Wolfe.