State Sen. Adriano Espaillat and Rep. Charles Rangel debate June 11 as part of the Democratic primary campaign for the 13th Congressional District in New York. (Pool photo by Pearl Gabel/via AP)

The birthday boy, turning 84, stood near the back of the room beneath white and gold balloons as friends, allies and supporters lined up for photos. Between photos, he stole swigs of the Corona Light gripped tightly in his left hand as the upbeat sounds of a local Latin band echoed off the dark walls.

The crowded fundraiser this month was a departure from Rep. Charles B. Rangel’s legendary birthday bashes of the past, which often were headlined by the likes of Aretha Franklin and Dionne Warwick and attended by New York’s black political royalty — former New York City mayor David Dinkins, the Rev. Al Sharpton and singer Harry Belafonte.

This year, many of the speakers were lesser-known Dominican activists and political strategists. The headliner was Dominican entertainer Frederick Martinez, also known as “El Pacha,” a popular Spanish-language radio and television host.

Those changes to the guest list tell almost the entire story of the political peril that threatens to end one of the iconic careers in American politics.

Over his 44 years in office, Rangel, “the congressman from Harlem,” became one of best-known political figures in American politics and a defining voice in the nation’s black politics.

Election Lab: See our current forecast for every congressional race in 2014

The longest-serving member of the influential New York delegation, he was one of the founders of the Congressional Black Caucus and over time came to represent one of the standards of Democratic liberalism.

But the campaign for the Democratic nomination for his seat, to be decided in a primary Tuesday, has turned into a debate about whether Rangel has stayed too long in office and whether he still best represents constituents’ interests.

Through immigration and redistricting, what is now New York’s 13th Congressional District — a seat Rangel has held since 1971 and viewed as the center of New York’s modern black political power structure — has experienced a seismic demographic shift from majority black to majority Hispanic.

Hoping to seize on those demographics as well as the perception of Rangel’s waning political power in the years since Congress formally censured him in 2010 for ethics violations, state Sen. Adriano Espaillat is mounting a spirited challenge to the 22-term incumbent — a rematch of the 2012 race in which Rangel topped Espaillat by just 1,000 votes.

But, vowing to not be taken by surprise, Rangel has campaigned hard and boasts the endorsements of many of the nation’s top Democrats. Former president Bill Clinton, House Minority Leader Nancy Pelosi (Calif.) and House Minority Whip Steny H. Hoyer (Md.) have lent their names to Rangel’s reelection bid which, if successful, is likely to make him the second-longest-serving current House member, behind Rep. John Conyers Jr. (D-Mich.), who also is seeking reelection. Rangel’s campaign has worked to underscore his links to local Hispanic communities, rolling out endorsements from Latino leaders.

“The Dominican people have in Congressman Rangel a big supporter and a big ally,” said Victor Gómez Casanova, a member of the Congress of the Dominican Republic who spoke at the birthday gala.

In recent years, Rangel’s district has been recarved, turning what has for years been a majority-black district into one that is 52 percent Hispanic and adding new parts of the Bronx where Rangel is not as well-known or as well-regarded.

“Dominicans have never had a congressman, and whenever that moment comes that they do, it will be a tremendous moment,” said former New York governor David Patterson. “But, if we’re thinking in a meritocracy, Congressman Rangel is working as hard now as some people are in their sixth and their eighth year” in Congress.

Rangel must contend with the lingering effects of a House Ethics Committee investigation, which found him guilty of 11 ethics violations, including not paying taxes and improperly using congressional resources. That scandal forced him to resign as chairman of the House Ways and Means Committee and prompted the censure.

There is a notion among some voters that Rangel is past its prime, and that is where Espaillat, 59, sees his opening. But the congressman is not going quietly. He has unleashed pointed attacks at Espaillat and is stressing his ties to the Hispanic community, noting in stump speeches that he is part Puerto Rican. He is making a virtue of his long tenure.

“For the nation, these next two years are going to make history,” Rangel told the packed room at his birthday gathering. “These next two years are not the years for someone who just has pride and ambition, it’s for someone . . . who has the experience to guide the ship into the dark for the next two years.”

Energetic and confident, Espaillat said he’s “feeling great” about his chances in next week’s vote, noting several prominent endorsements, including City Council Speaker Melissa Mark-Viverito and the Local 100 of the Transit Workers Union. Mayor Bill de Blasio, who once managed a Rangel campaign, has not made an endorsement.

On Wednesday, the New York Times editorial board endorsed Espaillat:

“After a humiliating censure by Congress four years ago for failing to pay taxes and other ethical lapses, Representative Charles Rangel has steadily lost power in Washington. After nearly 44 years in office, it is now time for him to yield to the next generation.”

John Samuelsen, president of the Transit Workers Union Local 100, said: “Everybody is tired of Rangel. We need a champion that will stand up for us. That’s not Charlie Rangel.” The union has said Rangel has not done enough to bring federal money to the district to fund transit worker jobs.

Meanwhile, Rangel has hit back at his opponents, leveling criticism and asserting that they would be unproductive replacements. During a debate in April, Rangel turned to his opponents and said, “If I thought for one minute that either one of you two can go to Washington, I’d be home with my wife and my grandkids.”

It’s attacks like those, as well as a series of anti-Espaillat mailings that Rangel put out in recent weeks, that Espaillat supporters point to as evidence that an upset is within reach.

“It’s a 44-year incumbent who is going negative now, at this point in the race,” said Jesse Campoamor, Espaillat’s campaign manager. “It’s a sign of desperation.”

A New York Times/NY1/Siena College poll in late May showed Rangel with the backing of 41 percent of likely voters — including two-thirds of black voters — and Espaillat pulling 32 percent, with the support of more than half of the district’s Hispanic voters.

But Rangel has been resilient, driving the campaign narrative in the race’s closing weeks and increasing his lead as the race enters its final days.

He was 13 percentage points ahead in the latest poll, an NY1/Siena College survey that measured him at 47 percent support compared with Espaillat’s 34 percent. The poll found Rangel with a commanding 76 percent among black voters vs. Espaillat’s 6 percent, while Espaillat was ahead 53 percent to 29 percent among Latino voters.

“With less than a week until voters go to the polls, the long-time incumbent appears to be holding off the challenger,” Siena College pollster Steven Greenberg said in a news release about the findings, which came out the same day the New York Times endorsed Espaillat.

The new poll found that single-digit slivers of the electorate say they support the Rev. Michael Walrond Jr. of Harlem, whose connection to Sharpton is expected to lead him to siphon votes from Rangel, and Bronx resident Yolanda Garcia, a Dominican political operative expected to cut into Espaillat’s share of the vote.