Mr. Rangel took the stage looking emotional, and sounded a note of damaged pride and fierce determination. He said of his critics, “If they didn’t think after 42 years that I was the best qualified, I promise them that in the next two years they’ll have no question about the fact that we elected the best.”

Yvonne Carr, 61, of West Harlem, was among Mr. Rangel’s supporters. “Sometimes other people throw their hat into the ring, and they haven’t really been out here in this community for a long time,” Ms. Carr said Tuesday morning. “I know he is elderly, but he’s been here.”

Mr. Rangel’s top challenger, State Senator Adriano Espaillat, would have been the first Dominican-born congressman had he defeated Mr. Rangel and won the November election. But his challenge was encumbered in part by the presence of three other candidates, including Clyde Williams, a former adviser to President Bill Clinton, and Joyce Johnson, a former local Democratic district leader.

At a restaurant in Washington Heights, as Latin music played in the background, Mr. Espaillat’s supporters huddled around a laptop as early returns showed their candidate in the lead. But as the night went on, the laptop was put away, and a lone supporter yelled an expletive when the Spanish-language television network Univision flashed the results.

Mr. Espaillat acknowledged defeat, saying, “We came in slightly short this time,” but he said, “The summer of 2012 will always be remembered as the summer when northern Manhattan came together.” He pledged to work with Mr. Rangel, saying, “We will be working with him to make sure the community gets what it deserves to get.”

Mr. Rangel’s fight for his party’s nomination, in New York’s 13th District, was the most closely watched of several competitive primaries as redistricting and retirements created the opportunity for change in the city’s Congressional delegation.