It was a gentle but unmistakable nudge President Obama gave Representative Charles B. Rangel recently, suggesting in an interview three weeks ago that Mr. Rangel, 80, should retire to “end his career with dignity.”

At a tense and sometimes fiery candidates’ forum Monday night, Mr. Rangel shot back that it was not his dignity the president should be worried about.

“Frankly, he has not been around long enough to determine what my dignity is,” Mr. Rangel said of the 49-year-old Mr. Obama. “For the next two years, I will be more likely to protect his dignity.”

The unexpected eruption seemed to reflect the increasingly bitter relations between the embattled 20-term Democrat from Harlem and a president who is trying to protect his party’s prospects in a difficult midterm election season.