State Sen. Adriano Espaillat appeared poised Wednesday to defeat longtime Rep. Charles Rangel’s chosen successor, Keith Wright, and become the first Dominican-American elected to Congress.

Espaillat’s 1,236-vote lead in unofficial returns exceeded the number of absentee ballots — 1,020 — yet to be tallied in the Democratic primary in the 13th congressional district in upper Manhattan and the southwest Bronx.

A New York City Board of Elections spokeswoman said the agency did not yet know how many affidavit ballots were out.

Espaillat declared victory Tuesday night, but Wright would not concede.

Wright’s campaign strategist told reporters the team was in discussions with lawyers about how to settle the election swiftly.

Wright campaign spokesman Charlie King said Wright was “disappointed” with his finish.

“We’re trying to get through to the process of making sure every vote is counted, and we get the right result and get the right person to represent this district,” King said.

advertisement | advertise on newsday

Rangel, who was first elected in 1970, told Fox 5 New York Wednesday he was “not confident at all” that Wright could overcome the vote deficit.

But Rangel criticized the handling of past races by the New York City Board of Elections and said he believes there should be a recount.

“I’m anxious to get it over, so I can help the newly elected congressman to make that transition in Washington before I leave,” Rangel said.

Espaillat, who has agreed to Wright’s call for a recount, struck a conciliatory tone on his opponent’s insistence that every ballot be tallied. Espaillat cited his close contests in 2012 and 2014 against Rangel.

“I know — first-hand — how tough it is to come up short in a hard-fought election,” Espaillat said in a statement.

“I have a real understanding of how crucial it is that every single voter’s constitutional right be upheld and that every vote is counted,” he said, adding that he is confident he will emerge as the Democratic nominee.

Espaillat had an edge of about 3 percentage points with 98 percent of precincts reporting, according to unofficial results.

Espaillat, would be the first non-black representative to Harlem since 1944.

Wright met Wednesday with the Rev. Al Sharpton in Harlem to discuss ways to unify the district, where the Latino population has grown as the number of African-American residents declined in recent years.