With 100 percent of precincts reporting on Wednesday, Rangel had received 47.4 percent of the vote to Espaillat's 43.6 percent. The Associated Press called the race for Rangel Wednesday afternoon.
In the final weeks of a long and bitter race, Espaillat had repeatedly criticized Rangel over his close ties to Wall Street. During a televised debate earlier this month, the state senator called out Rangel for voting in the late 1990s to repeal the Glass-Steagall Act. Its repeal, which allowed banks to grow in size and make riskier investments, is often cited as the cause of the 2008 financial crisis.
Espaillat also attacked Rangel over his vote to roll back a crucial part of the 2010 Dodd-Frank financial reform law. Rangel voted last year for a measure that reinstated taxpayer support for risky derivative trades by big banks.
As late as Tuesday afternoon, while making one of his final campaign stops outside a subway station in Harlem, Espaillat told The Huffington Post he believed the attacks on Rangel would resonate with voters, and lift him to victory.
"The Latino community lost over 60 percent of its assets as well," he said of the financial crisis. "The black community 55 percent. The white community, 20. Sometimes it's only the insiders that know the impact of those votes and the consequences that they have, and so, you know, it gets lost in the jargon. But I think now, after we've gone through the crisis, the recession, to tell them how this was done, it spreads out and people say, 'Wait, I'm hurting and this is the root of it.'"
Espaillat added that Rangel had "sided with the fat cats on Wall Street as opposed to the average person here on 116th Street."
It's unclear, however, if those kind of attacks on Rangel had any effect at all. Instead, voters in the 13th District -- which includes the Harlem, Inwood and Washington Heights neighborhoods of Manhattan, as well as parts of the Bronx -- appear to have voted primarily along ethnic lines on Tuesday.
Alonzo Perez, 38, is a musician and IT worker who has lived in Inwood for 20 years. He said he supported Espaillat largely because the senator is from the neighborhood, and is someone he's seen in person on multiple occasions.
"He's a part of my community," Perez said outside P.S. 152, where he voted for Espaillat Tuesday. “He grew up in my community, and I think that he will probably help a lot in our community. Also, I see him around, I see how he carries himself." Perez added that he’d never seen Rangel in the neighborhood.
Further downtown in Spanish Harlem, Carlos Real, 61, said he had voted for Espaillat because it was time for a change. Rangel, who's been a congressman for nearly 44 years, has had his chance, Real said.
"We need a change in our lives," Real said. "We need a whole different environment. Charles Rangel's done what he's done in his era. We need something new. Things aren't progressing."
For most of Rangel's tenure, his district was primarily black. But since the redistricting that occurred in 2012, nearly 46 percent of eligible voters are Latino, while just 34 percent are black.
In the 2012 primary, Rangel only beat Espaillat by a little over 1000 votes, despite earning most of the black vote. Espaillat, who would've been the United States' first Dominican-American congressman, got most of the Latino vote in both match-ups.
According to Evan Stavisky, a Democratic strategist who worked on neither campaign, the outcomes of primaries in New York City have historically hinged less on the policy differences between candidates and more on demographics.
“What’s left to draw distinctions but tribal loyalties?” Stavisky said.
"The complexities of ethnic politics in New York City are tremendous," he said. "They’re not for the faint of heart. It may be kind of old school in the modern world, but it still exists, and it’s what enables Charlie Rangel to build a winning coalition.”
Part of that coalition may have come from the Puerto Rican community. According to a WNYC analysis, Rangel, who is half-Puerto Rican, got 57 percent of the vote in Puerto Rican areas of the district, while Espaillat only got 35 percent.